Skip to content

Commit 3f99790

Browse files
Zegerieagleivg
authored andcommitted
Force 4.5 OpenGL usage
1 parent 7eafbf4 commit 3f99790

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/Layers/xrRenderGL/glHW.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ void CHW::CreateDevice(SDL_Window* hWnd)
5959
return;
6060
}
6161

62-
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
63-
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
64-
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
65-
6662
// Initialize OpenGL Extension Wrangler
6763
if (glewInit() != GLEW_OK)
6864
{

src/xrEngine/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "
3535
cotire(${PROJECT_NAME})
3636

3737
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
38-
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})
38+
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})
3939
xr_install(${PROJECT_NAME})
4040

src/xrEngine/Device_Initialize.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "stdafx.h"
22
#include "xr_3da/resource.h"
33
#include "SDL.h"
4-
54
#include "Include/editor/ide.hpp"
65
#include "engine_impl.hpp"
76
#include "xr_input.h"
@@ -50,8 +49,16 @@ void CRenderDevice::Initialize()
5049
const Uint32 flags = SDL_WINDOW_BORDERLESS | SDL_WINDOW_HIDDEN |
5150
SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL;
5251

53-
m_sdlWnd = SDL_CreateWindow("S.T.A.L.K.E.R.: Call of Pripyat", 0, 0, 640, 480, flags);
52+
#ifdef USE_OGL
53+
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
54+
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
55+
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 5);
56+
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
57+
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
58+
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
59+
#endif
5460

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

0 commit comments

Comments
 (0)