Skip to content

Commit 35c45e0

Browse files
committed
glad: implement Windows fixes suggested by Bertrand
1 parent 15e7019 commit 35c45e0

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

graf3d/eve/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ if(MSVC)
238238
RGL
239239
Physics
240240
)
241+
target_compile_definitions(Eve PRIVATE GLAD_API_CALL_EXPORT)
241242

242243
ROOT_GENERATE_DICTIONARY(G__Eve2
243244
${EVE_HEADERS2}

graf3d/ftgl/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ ROOT_LINKER_LIBRARY(FTGL
4444
BUILTINS
4545
FREETYPE
4646
)
47+
if(MSVC)
48+
target_compile_definitions(FTGL PRIVATE GLAD_API_CALL_EXPORT)
49+
endif()
4750

4851
target_include_directories(FTGL PRIVATE
4952
${FREETYPE_INCLUDE_DIRS}

graf3d/gl/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ ROOT_STANDARD_LIBRARY_PACKAGE(RGL
220220
INSTALL_OPTIONS
221221
${installoptions}
222222
)
223+
if(MSVC)
224+
target_compile_definitions(RGL PRIVATE GLAD_API_CALL_EXPORT)
225+
endif()
223226

224227
target_include_directories(RGL PRIVATE
225228
${OPENGL_INCLUDE_DIR}

graf3d/gl/src/TGLWidget.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ void TGLWidget::SetFormat()
383383
static bool wgl_init = false;
384384
if ( ! wgl_init) {
385385
wgl_init = true;
386-
int status = gladLoaderLoadWGL(HDC);
386+
int status = gladLoaderLoadWGL(hDC);
387387
printf("GLAD loader WGL version %d.%d\n", GLAD_VERSION_MAJOR(status), GLAD_VERSION_MINOR(status));
388388
}
389389

graf3d/rglew/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ endif()
2424

2525
if(MSVC)
2626
list(APPEND rglew_srcs src/wgl.c)
27+
list(APPEND rglew_libs OpenGL32.lib)
2728
endif()
2829

2930
ROOT_LINKER_LIBRARY(RGlew ${rglew_srcs} LIBRARIES ${rglew_libs})
31+
if(MSVC)
32+
target_compile_definitions(RGlew PRIVATE GLAD_API_CALL_EXPORT GLAD_API_CALL_EXPORT_BUILD)
33+
endif()
3034

3135
# We still need to install TGLIncludes.h into include/
3236
ROOT_INSTALL_HEADERS()

0 commit comments

Comments
 (0)