From: Timothy J. W. <tj...@om...> - 2001-08-05 23:23:12
|
OK, it turns out that the function returned by GetProcAddress works just fine (I was confused by gdb being lame on Win32 -- 'ni' doesn't work when stepping over the 'call *%eax' for this func pointer). Anyway, the actual crasher comes later when a floating point values gets stored to the stack to be passed as an argument to fprintf. Sadly, the frame pointer is messed up somehow and that float gets written over the stored frame pointer. Later when we return, a float gets loaded into $fp and it is all down hill from there :) I'm not sure yet if this is a compiler bug or some really subtle bug in my code. -tim On Saturday, August 4, 2001, at 09:42 PM, Timothy J. Wood wrote: > > > For nefarious purposes of my own, I would like to be able to get at > GL function pointers and never directly reference the GL API. > > If I do the following: > > fprintf(stderr, "glGetString: 0x%08x\n", glGetString); > fprintf(stderr, "wglGetProcAddress(glGetString): 0x%08x\n", > wglGetProcAddress("glGetString")); > > library = LoadLibrary("opengl32"); > fprintf(stderr, "GetProcAddress(opengl32, glGetString): 0x%08x\n", > GetProcAddress(library, "glGetString")); > > > I get the right result for the first log message. I get NULL for the > second (I guess because this isn't an extension). I get a totally > weird address from the third approach (and I crash if I try to call the > result as a function pointer). > > Can someone illuminate me as to why I would get a different result > from GetProcAddress on opengl32.dll than I get from linking to > opengl32.lib? I would really expect to get the same result.... > > Is there some way that I can get the right result from GetProcAddress? > > Thanks! > > -tim > > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options at: > http://lists.sourceforge.net/lists/listinfo/mingw-users > |