irrlicht ogles2 win32 work good~~~
Posted: Mon Jun 29, 2015 8:54 pm
Win32 libGLESv2.dll use AngleProject instruction set with SSE(not SSE2)
git clone https://chromium.googlesource.com/angle/angle
Revision: cc4ec64cda54f4b138f8d16ce0fe40b8fcedb459
Date: 2013/9/24 Am 02:57:10
Preinstall vs2010 and directX sdk 2010
///
VS2010 build
http://www.mediafire.com/file/n81r28nym ... eGLes2.rar
/////
/////EGL initial
/////
#if defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_)
void XmEGLInit()
{
int eRet;
int major = 0;
int minor = 0;
int configs = 0;
int config_attrs[] =
{
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_BUFFER_SIZE, 16,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_SAMPLE_BUFFERS, 0,
EGL_SAMPLES, 0,
#ifdef _IRR_COMPILE_WITH_OGLES1_
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
#else
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
#endif
EGL_NONE, 0
};
/*context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
context_attrs[1] = 1;
context_attrs[2] = EGL_NONE;*/
int context_attrs[] =
{
#ifdef _IRR_COMPILE_WITH_OGLES1_
EGL_CONTEXT_CLIENT_VERSION, 1,
#else
EGL_CONTEXT_CLIENT_VERSION, 2,
#endif
EGL_NONE, 0
};
s_egl_display = eglGetDisplay ( g_hDC );
if ( s_egl_display == EGL_NO_DISPLAY )
{
return;
}
if ( !eglInitialize ( s_egl_display, &major, &minor ) )
{
return;
}
if ( !eglChooseConfig ( s_egl_display, config_attrs, &g_egl_config, 1, &configs ) || ( configs != 1 ) )
{
return;
}
s_egl_surface = eglCreateWindowSurface ( s_egl_display, g_egl_config, g_hWnd, 0 );
if ( eglGetError() != EGL_SUCCESS )
{
return;
}
eRet = eglBindAPI( EGL_OPENGL_ES_API );
s_egl_context = eglCreateContext ( s_egl_display, g_egl_config, EGL_NO_CONTEXT, context_attrs );
if ( eglGetError() != EGL_SUCCESS )
{
return;
}
eglMakeCurrent ( s_egl_display, s_egl_surface, s_egl_surface, s_egl_context );
if ( eglGetError() != EGL_SUCCESS )
{
return;
}
}
#endif
//////process egl buffer
if (g_bHasFocus && !g_bIsMinimized)
{
#if defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_)
eglSwapBuffers ( s_egl_display, s_egl_surface );
#else
SwapBuffers(g_hDC); //need it
#endif
}
///////destory egl buffer
#if defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_)
eglSwapBuffers(s_egl_display, s_egl_surface);
eglMakeCurrent(s_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
eglDestroySurface(s_egl_display, s_egl_surface);
eglDestroyContext(s_egl_display, s_egl_context);
eglTerminate(s_egl_display);
#else
if (g_hRC) // Do We Have A Rendering Context?
{
if (!wglMakeCurrent(NULL,NULL)) // Are We Able To Release The DC And RC Contexts?
{
MessageBox(NULL,L"Release Of DC And RC Failed.",L"SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
}
if (!wglDeleteContext(g_hRC)) // Are We Able To Delete The RC?
{
MessageBox(NULL,L"Release Rendering Context Failed.",L"SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
}
g_hRC=NULL; // Set RC To NULL
}
#endif
////full example here
https://github.com/fatalfeel/proton_cm_ ... p/main.cpp
git clone https://chromium.googlesource.com/angle/angle
Revision: cc4ec64cda54f4b138f8d16ce0fe40b8fcedb459
Date: 2013/9/24 Am 02:57:10
Preinstall vs2010 and directX sdk 2010
///
VS2010 build
http://www.mediafire.com/file/n81r28nym ... eGLes2.rar
/////
/////EGL initial
/////
#if defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_)
void XmEGLInit()
{
int eRet;
int major = 0;
int minor = 0;
int configs = 0;
int config_attrs[] =
{
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_BUFFER_SIZE, 16,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_SAMPLE_BUFFERS, 0,
EGL_SAMPLES, 0,
#ifdef _IRR_COMPILE_WITH_OGLES1_
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
#else
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
#endif
EGL_NONE, 0
};
/*context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
context_attrs[1] = 1;
context_attrs[2] = EGL_NONE;*/
int context_attrs[] =
{
#ifdef _IRR_COMPILE_WITH_OGLES1_
EGL_CONTEXT_CLIENT_VERSION, 1,
#else
EGL_CONTEXT_CLIENT_VERSION, 2,
#endif
EGL_NONE, 0
};
s_egl_display = eglGetDisplay ( g_hDC );
if ( s_egl_display == EGL_NO_DISPLAY )
{
return;
}
if ( !eglInitialize ( s_egl_display, &major, &minor ) )
{
return;
}
if ( !eglChooseConfig ( s_egl_display, config_attrs, &g_egl_config, 1, &configs ) || ( configs != 1 ) )
{
return;
}
s_egl_surface = eglCreateWindowSurface ( s_egl_display, g_egl_config, g_hWnd, 0 );
if ( eglGetError() != EGL_SUCCESS )
{
return;
}
eRet = eglBindAPI( EGL_OPENGL_ES_API );
s_egl_context = eglCreateContext ( s_egl_display, g_egl_config, EGL_NO_CONTEXT, context_attrs );
if ( eglGetError() != EGL_SUCCESS )
{
return;
}
eglMakeCurrent ( s_egl_display, s_egl_surface, s_egl_surface, s_egl_context );
if ( eglGetError() != EGL_SUCCESS )
{
return;
}
}
#endif
//////process egl buffer
if (g_bHasFocus && !g_bIsMinimized)
{
#if defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_)
eglSwapBuffers ( s_egl_display, s_egl_surface );
#else
SwapBuffers(g_hDC); //need it
#endif
}
///////destory egl buffer
#if defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_)
eglSwapBuffers(s_egl_display, s_egl_surface);
eglMakeCurrent(s_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
eglDestroySurface(s_egl_display, s_egl_surface);
eglDestroyContext(s_egl_display, s_egl_context);
eglTerminate(s_egl_display);
#else
if (g_hRC) // Do We Have A Rendering Context?
{
if (!wglMakeCurrent(NULL,NULL)) // Are We Able To Release The DC And RC Contexts?
{
MessageBox(NULL,L"Release Of DC And RC Failed.",L"SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
}
if (!wglDeleteContext(g_hRC)) // Are We Able To Delete The RC?
{
MessageBox(NULL,L"Release Rendering Context Failed.",L"SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
}
g_hRC=NULL; // Set RC To NULL
}
#endif
////full example here
https://github.com/fatalfeel/proton_cm_ ... p/main.cpp