Jump to content


OpenGL, Pointers, DLL's, and texture ID's


2 replies to this topic

#1 Nicholas Christopher

    Member

  • Members
  • PipPip
  • 77 posts

Posted 08 February 2008 - 05:53 PM

I am calling Gl functions in a DLL that have been assigned to pointers in an EXE then passed to the DLL through a struct.

// IN EXE
tGUMIToolsSetup.____glewActiveTexture= glActiveTexture;

// IN DLL
 #define glActiveTexture  lptGUMIToolsSetup->____glewActiveTexture 


Context and GL initialization is set in the EXE.

Everything works, except texture ID's are not being respected/maintained.
What I mean here is glBindTexture, or glActiveTexture seems to fail.

When I change the view , textures are switching between one and the next.

The same code in the DLL if executed in the EXE works perfectly.

Anyone run into this problem?
Nicholas Christopher
Architecture software development, and modeling
http:\\www.arconovum.com

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 08 February 2008 - 07:18 PM

Try calling wglMakeCurrent in your DLL before your GL calls?

Also, why not just include glew in your DLL, rather than using this roundabout way of getting the GL function pointers?
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 Nicholas Christopher

    Member

  • Members
  • PipPip
  • 77 posts

Posted 08 February 2008 - 07:47 PM

Hi Reed,

You question made me ponder, and so I tried it a second time, and this time I called glewInit(); obviously in the EXE but again a second time in the DLL.

This has worked..

Thanks for the light.
Nicholas Christopher
Architecture software development, and modeling
http:\\www.arconovum.com





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users