
Hi again, I've just solved my previous problem I had with the new HOpenGlRaw package. It seems that wglGetProcAddress wont retreieve pointers for core 1.1 functions (like glClearColor) and these must be retrieved with standard GetProcAddress calls instead (see http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=261994). I made these changes to cbits/HsOpenGLRaw.hs [18-22]: void* hs_OpenGLRaw_getProcAddress(const char *name) { void* p = wglGetProcAddress((LPCSTR)name); if (p) return p; else return GetProcAddress(GetModuleHandle("opengl32"),(LPCSTR)name); } With those changes everything now works fine! I suggest you incorporate it into the next revision to make HOpenGLRaw work on windows for those of us that has opengl 3.1 hardware and drivers. Regards /Tobias Bexelius From: tobias_bexelius@hotmail.com To: hopengl@haskell.org Subject: OpenGLRaw on Windows Vista Date: Wed, 2 Sep 2009 21:51:38 +0200 Hi, I'm having trouble with the new Opengl 2.3.0.0 that's based on openglRaw. When I run an old opengl example (http://netsuperbrain.com/blog/wp-content/uploads/2008/11/teapots.hs) that used to work with previous versions of HOpenGL, I get the following error: teapots.exe: user error (unknown OpenGL extension entry glLightfv, check for GL_ARB_compatibility) This seems reasonable (OpenGl 3.1 doesnt support that fixed-function stuff without explicitly turning it on), but when I try to run my own small test program I get similar errors for OpenGL 3.1 stuff too: Test.exe: user error (unknown OpenGL extension entry glClearColor, check for OpenGL 3.1) If I don't put the glut32.dll in the same directory as those examples, I get an error saying something like: teapots.exe: user error (unknown GLUT entry glutInit) so maybe I need to tell my executables where to find the opengl dll to link against. I've tried to put opengl32.dll in the same directory, but with no luck. Suggestions, anyone? I have a Opengl 3.1 capable graphics card (ATI Radeon 4850) with new drivers (Castalyst 9.8). /Tobias Bexelius Använd nätet för att dela med dig av dina minnen till vem du vill. _________________________________________________________________ Med Windows Live kan du ordna, redigera och dela med dig av dina foton. http://www.microsoft.com/sverige/windows/windowslive/products/photo-gallery-...

Am Samstag, 5. September 2009 09:45:25 schrieb Tobias Bexelius:
[...] It seems that wglGetProcAddress wont retreieve pointers for core 1.1 functions (like glClearColor) and these must be retrieved with standard GetProcAddress calls instead [...]
Hmmm, as usual, Windows seems to behave in a very obscure way. On an XP machine with a cheap on-board Intel chip, I *do* get all core API entries via WGL. Nevertheless, falling back to plain GetProcAddress when WGL fails seems to be safer and I will incorporate this in the next release. Thanks for the report, S.
participants (2)
-
Sven Panne
-
Tobias Bexelius