diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index d45bc0bff..47c003dce 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/src/eepp/graphics/renderer/rendererhelper.hpp b/src/eepp/graphics/renderer/rendererhelper.hpp index 05bba7daa..809633f09 100644 --- a/src/eepp/graphics/renderer/rendererhelper.hpp +++ b/src/eepp/graphics/renderer/rendererhelper.hpp @@ -11,20 +11,13 @@ namespace EE { namespace Graphics { namespace Private { static void fromGLMmat4( glm::mat4 from, GLfloat * to ) { - Int32 i,p; - - for ( i = 0; i < 4; i++ ) { - glm::vec4 v = from[i]; - p = i * 4; - to[p ] = v.x; - to[p+1] = v.y; - to[p+2] = v.z; - to[p+3] = v.w; - } + memcpy( to, &from[0][0], sizeof(glm::mat4) ); } static glm::mat4 toGLMmat4( const GLfloat * m ) { - return glm::mat4( m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8], m[9], m[10], m[11], m[12], m[13], m[14], m[15] ); + glm::mat4 Result; + memcpy( &Result[0][0], m, sizeof(glm::mat4)); + return Result; } class cMatrixStack @@ -42,4 +35,3 @@ using namespace EE::Graphics::Private; #endif #endif - diff --git a/src/eepp/window/backend/SDL2/cwindowsdl2.cpp b/src/eepp/window/backend/SDL2/cwindowsdl2.cpp index 569d5f8f4..659870f0b 100644 --- a/src/eepp/window/backend/SDL2/cwindowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/cwindowsdl2.cpp @@ -64,7 +64,8 @@ namespace EE { namespace Window { namespace Backend { namespace SDL2 { cWindowSDL::cWindowSDL( WindowSettings Settings, ContextSettings Context ) : cWindow( Settings, Context, eeNew( cClipboardSDL, ( this ) ), eeNew( cInputSDL, ( this ) ), eeNew( cCursorManagerSDL, ( this ) ) ), mSDLWindow( NULL ), - mGLContext( NULL ) + mGLContext( NULL ), + mGLContextThread( NULL ) #ifdef EE_USE_WMINFO , mWMinfo( eeNew( SDL_SysWMinfo, () ) ) @@ -197,7 +198,7 @@ bool cWindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { mGLContext = SDL_GL_CreateContext( mSDLWindow ); mGLContextThread = SDL_GL_CreateContext( mSDLWindow ); - if ( NULL == mGLContext ) { + if ( NULL == mGLContext || NULL == mGLContextThread ) { cLog::instance()->Write( "Unable to create context: " + std::string( SDL_GetError() ) ); LogFailureInit( "cWindowSDL", GetVersion() ); @@ -207,13 +208,13 @@ bool cWindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { SDL_GL_SetSwapInterval( ( mWindow.ContextConfig.VSync ? 1 : 0 ) ); // VSync + SDL_GL_MakeCurrent( mSDLWindow, mGLContext ); + if ( NULL == cGL::ExistsSingleton() ) { cGL::CreateSingleton( mWindow.ContextConfig.Version ); cGL::instance()->Init(); } - SDL_GL_MakeCurrent( mSDLWindow, mGLContext ); - CreatePlatform(); GetMainContext(); diff --git a/src/eepp/window/backend/allegro5/cwindowal.cpp b/src/eepp/window/backend/allegro5/cwindowal.cpp index 5d550f5c3..4a2829180 100644 --- a/src/eepp/window/backend/allegro5/cwindowal.cpp +++ b/src/eepp/window/backend/allegro5/cwindowal.cpp @@ -193,10 +193,9 @@ bool cWindowAl::Create( WindowSettings Settings, ContextSettings Context ) { if ( NULL == cGL::ExistsSingleton() ) { cGL::CreateSingleton( mWindow.ContextConfig.Version ); + cGL::instance()->Init(); } - cGL::instance()->Init(); - CreatePlatform(); GetMainContext();