I'm working on a game which will run on both OS X and Windows. But for some a few core functions like glBindBuffer come up as nil after I run ReadExtensions(). It runs correctly on the windows environment but crashes on OS X 10.6.8 running OpenGL 2.1. For my game I'm using SDL to create my window and then I call I call InitOpenGL() and then ReadExtentions() I'm able to get most of the core functions to work and the game to run and render. But there's only a few functions like glBindBuffer and glGenFramebuffersEXT that return nil.
@phlegmatiker - I've tried glBindBufferARB and glGenFramebuffers and both come up as nil as well. I'm using the latest version of dglOpenGL.pas and FPC to compile my project. I didn't find glGenFramebuffersARB defined in the dglOpenGL file.
@CoolCat- Since I'm using dglOpenGL I assumed I got the following header files glext.h, gl_1_1.h, glu.h and weglext.h. Thanks for suggesting the work around for glBufferSubData I'm going to see if there's a work around for what I'm trying to do.
If anyone has any other suggestions I will gladly try them since I've been beating my head against the wall on this problem for quite some time.
After looking deeper, it seems that none of the dglOpenGL functions seem to return anything after dglGetProcAddress is called. Since I'm compiling it using FPC, I get a the GL unit which I believe are the OpenGL function pointers I'm using instead of dglOpenGL function pointers. I'm still trying to figure out what the problem is but here is my compile string
For my specific situation it seems to be. I had to compile OpenGL into my project so I am able to use the gl unit, which has the wgl* function defined. For some reason the way dglOpenGL was getting the proc address was always returning a nil value for even simple functions like glGetString().
Oddly enough it did work for me. I had to add to the top of dglProcAddress with {$IFDEF MACOS} Result := wglGetProcAddress(ProcName); exit; {$ENDIF} As well as add the gl, glu, and glext units to the uses case.
If I didn't add them then all of the dgl function pointers always returned nil for me.
I'm thinking this works for me because I'm compiling OpenGL with FPC. I'm not sure why it doesn't work using the traditional dlsym function call.
Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.