Skip to content

Commit

Permalink
Force 4.5 OpenGL usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Zegeri authored and eagleivg committed Nov 6, 2018
1 parent 7eafbf4 commit 3f99790
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/Layers/xrRenderGL/glHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ void CHW::CreateDevice(SDL_Window* hWnd)
return;
}

SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);

// Initialize OpenGL Extension Wrangler
if (glewInit() != GLEW_OK)
{
Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "
cotire(${PROJECT_NAME})

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} xrCore xrMiscMath luabind xrAPI xrSound xrScriptEngine xrNetServer ${LUA_LIBRARIES} ${THEORA_LIBRARY} ${OGG_LIBRARIES} xrCDB xrPhysics ${FREEIMAGE_LIBRARY} openal ${LOCKFILE_LIBRARIES} ${SDL_LIBRARIES})
target_link_libraries(${PROJECT_NAME} xrCore xrMiscMath luabind xrAPI xrSound GLEW xrScriptEngine xrNetServer ${LUA_LIBRARIES} ${THEORA_LIBRARY} ${OGG_LIBRARIES} xrCDB xrPhysics ${FREEIMAGE_LIBRARY} openal ${LOCKFILE_LIBRARIES} ${SDL_LIBRARIES})
xr_install(${PROJECT_NAME})

11 changes: 9 additions & 2 deletions src/xrEngine/Device_Initialize.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "stdafx.h"
#include "xr_3da/resource.h"
#include "SDL.h"

#include "Include/editor/ide.hpp"
#include "engine_impl.hpp"
#include "xr_input.h"
Expand Down Expand Up @@ -50,8 +49,16 @@ void CRenderDevice::Initialize()
const Uint32 flags = SDL_WINDOW_BORDERLESS | SDL_WINDOW_HIDDEN |
SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL;

m_sdlWnd = SDL_CreateWindow("S.T.A.L.K.E.R.: Call of Pripyat", 0, 0, 640, 480, flags);
#ifdef USE_OGL
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 5);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
#endif

m_sdlWnd = SDL_CreateWindow("S.T.A.L.K.E.R.: Call of Pripyat", 0, 0, 640, 480, flags);
R_ASSERT3(m_sdlWnd, "Unable to create SDL window", SDL_GetError());
SDL_SetWindowHitTest(m_sdlWnd, WindowHitTest, nullptr);
SDL_SetWindowMinimumSize(m_sdlWnd, 256, 192);
Expand Down

0 comments on commit 3f99790

Please sign in to comment.