Commits

Anonymous committed 6da69d6

Fixes for build warnings in GLLoad build.
Tested on Linux.

  • Participants
  • Parent commits 4b44145

Comments (0)

Files changed (4)

modules/StyleGLLoadC.lua

 end
 
 function source.WriteLoadFunction(hFile, func, typemap, spec, options)
-	hFile:fmt('%s = %s("%s");\n',
+	hFile:fmt('%s = (%s)%s("%s");\n',
 		glload.GetFuncPtrName(func, spec, options),
+		glload.GetFuncTypedefName(func, spec, options),
 		common.GetProcAddressName(spec),
 		common.GetOpenGLFuncName(func, spec))
 	hFile:fmt("if(!%s) ++numFailed;\n",
 end
 
 function source.WriteLoadFunctionCore(hFile, func, typemap, spec, options)
-	hFile:fmt('%s = %s("%s");\n',
+	hFile:fmt('%s = (%s)%s("%s");\n',
 		glload.GetFuncPtrName(func, spec, options),
+		glload.GetFuncTypedefName(func, spec, options),
 		common.GetProcAddressName(spec),
 		common.GetOpenGLFuncName(func, spec))
 		

modules/glload_util.lua

 
 function data.GetInMainFuncLoader(hFile, func, spec, options)
 	local ret = ""
-	ret = ret .. string.format('%s = %s("%s%s");\n',
+	ret = ret .. string.format('%s = (%s)%s("%s%s");\n',
 		data.GetFuncPtrName(func, spec, options),
+		data.GetFuncTypedefName(func, spec, options),
 		common.GetProcAddressName(spec),
 		spec.FuncNamePrefix(), func.name)
 	ret = ret .. string.format('if(!%s) return %s;\n',

test/premake4.lua

 		links {"glu32", "opengl32", "gdi32", "winmm", "user32"}
 		
 	configuration "linux"
-		links {"GL", "GLU", "Xrandr"}
+		links {"GL", "GLU", "Xrandr", "X11"}
 		
 	configuration "Debug"
 		targetsuffix "D"
 
 #include "glload/gl_4_3.h"
 #include "glload/gl_load.h"
-#include "glload/wgl_all.h"
-#include "glload/wgl_load.h"
+//#include "glload/wgl_all.h"
+//#include "glload/wgl_load.h"
 #include <GL/freeglut.h>
 
 GLuint positionBufferObject;
 
 	init();
 
-	HDC hdc = wglGetCurrentDC();
-	numFailed = wgl_LoadFunctions(hdc);
-	printf("WGL: %i\n", numFailed);
+//	HDC hdc = wglGetCurrentDC();
+//	numFailed = wgl_LoadFunctions(hdc);
+//	printf("WGL: %i\n", numFailed);
 
 	glutDisplayFunc(display); 
 	glutReshapeFunc(reshape);