Jump to content
  • Advertisement
Sign in to follow this  
xpnctoc

OpenGL Multitexturing extensions in Win 7???

This topic is 3267 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I apologize in advance if this post really belongs under "hardware". I'm starting here because the immediate issue was discovered in a step-trace of my code... I write web-based business apps by day and OpenGL games as a hobby. I thought I was learning the OpenGL ropes pretty well until I got this machine loaded with Win 7 RTM. None of my OpenGL apps run anymore. Step-tracing has shown that my code dies at the point I'm trying to access the multitexturing extensions. My delegate variables are all "null" (C#), so any attempt to do something with them causes the crash (no, I haven't put in any error checking -- it's a hobby). An example of how I'm trying to get these delegates is this: public PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)Marshal.GetDelegateForFunctionPointer( wgl.wglGetProcAddress("glActiveTextureARB"), typeof(PFNGLACTIVETEXTUREARBPROC)); This worked fine on an identical machine loaded with WinXP PRO. Does anyone know the "magic" to gaining access to these extensions under Windows 7? (THANK YOU FOR FRAKKING IT ALL UP, MICROSOFT!) In case this is a hardware/driver issue, my old and new notebooks were both HP nc8430. (Not my choice. I hate HP with a passion. But its what my company bought.) The graphics are ATI Mobility Radeon X1600. The driver is ver 8.561 (12/1/2008).

Share this post


Link to post
Share on other sites
Advertisement
Additional info: I tried just looking at the return of glGetString(GL_EXTENSIONS). A null string is returned. So apparently in my Win 7 setup I have no access to any extensions at all. What am I missing?

Share this post


Link to post
Share on other sites
What is the versions of openGl of each machine? IDK how version of OGL are running under Win 7 by default.
You already update the drivers under Win7?

Share this post


Link to post
Share on other sites
On PCs, graphics library support is provided by video card drivers, it doesn't really have anything directly to do with the operating system. My guess is that the driver you have installed for your graphics card just either doesn't work in Windows 7 or wasn't properly installed (assuming the card you have supports those extensions)

-me

Share this post


Link to post
Share on other sites
Thanks for your input. I've discovered I was looking in the wrong direction.

By moving some code around, I've been able to pin the problem on the glGetString() call itself. If I remove it completely and just try to get the delegates for the extension calls, everything works perfectly.

Originally my check for multitexturing looked like this:


gl.glGetString(gl.GL_EXTENSIONS).IndexOf("GL_ARB_multitexture") > -1

("gl." at the start indicates a managed wrapper class called "gl")

Obviously this would throw an error if gl.glGetString() returned a null string. You can't invoke .IndexOf() on a null string. So I broke the code out a little more:


string s = gl.glGetString(gl.GL_EXTENSIONS);
if (s != null)
return (s.IndexOf("GL_ARB_multitexutre") > -1);
return false;

But the app crashes on the first line. "gl.glGetString" itself is a reference to the OpenGL API itself (via DllImport). There's nothing else to step into. Somehow that call is crashing and I have no idea why.

I guess I don't really need it. I mean, if my extension delegates are something other than null after initialization, then the extension exists. And my app is now running with multitexturing fully working, so I know my drivers are OK.

I guess at this point the fact that glGetString isn't working is more of an annoyance than a serious hiderance. But it's an annoyance nonetheless.

Share this post


Link to post
Share on other sites
Do you have an OpenGL context initialized and current when you call glGetString? You can check that printing the outputs of glGetString(GL_VERSION) and glGetString(GL_VENDOR).

Share this post


Link to post
Share on other sites
Huntsman:

Maybe I'm missing a step that I need? I do create the context first. The call to glGetString(GL_EXTENSIONS) that is failing is during the initialization of subsequent application data.

I tried adding the two calls you suggested. GL_VENDOR returns "ATI Technologies Inc.", but GL_VERSION causes an AccessViolationException (.NET) with the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!