Jump to content
  • Advertisement
Sign in to follow this  
Sigvatr

OpenGL GL Extensions not working on laptop

This topic is 3179 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

Hey there, I've got my code all set up to use the necessary extensions that I am using in my application and it compiles and runs perfectly fine on my PC, but on my laptop, I've come to the conclusion that the extensions are causing it not to run. From debugging, I can see that my code always crashes anytime I'm trying to use an extension, but the debugger can't really explain what the problem is. I have a feeling that my graphics card might not support OpenGL extensions. The graphics chipset in use in my laptop is the Mobile Intel 4 Series Express chipset. Reading up on it, it apparently supports up to OpenGL 2.1, but the extensions I need to use don't even go up that far. I'm trying to see if I can upgrade my drivers but I don't know if that is going to work. I've never had any problems playing any games on this laptop, although I'm not sure if they used OpenGL or not. Here's how I'm using my code:
/// vertical synchronization extension parameters
typedef void( APIENTRY *PFNWGLEXTSWAPCONTROLPROC )(int);
typedef int( *PFNWGLEXTGETSWAPINTERVALPROC )(void);
PFNWGLEXTSWAPCONTROLPROC wglSwapIntervalEXT = NULL;
PFNWGLEXTGETSWAPINTERVALPROC wglGetSwapIntervalEXT = NULL;

/// vertical synchronization initialization
void init_vsync()
{
	char* vsync_extension = (char*)glGetString( GL_EXTENSIONS );
	if( strstr( vsync_extension, "WGL_EXT_swap_control" ) )
	{		
		wglSwapIntervalEXT = ( PFNWGLEXTSWAPCONTROLPROC )wglGetProcAddress( "wglSwapIntervalEXT" );
		wglGetSwapIntervalEXT =	( PFNWGLEXTGETSWAPINTERVALPROC )wglGetProcAddress( "wglGetSwapIntervalEXT" );
	}
}
/// set vertical synchronization state
void set_vsync( bool state )
{
	if( state )
	{
		wglSwapIntervalEXT( 1 );
	}
	else
	{
		wglSwapIntervalEXT( 0 );
	}
}
And another one:
		typedef void( APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC )( GLsizei n, GLuint *framebuffers );
		typedef void( APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC )( GLenum target, GLuint framebuffer );
		typedef void( APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC )( GLenum target, GLenum internalformat, GLsizei width, GLsizei height );
		typedef void( APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC )( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer );
		typedef void( APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC )( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level );
		PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
		PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
		PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT;
		PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
		PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;

			glGenFramebuffersEXT = ( PFNGLGENFRAMEBUFFERSEXTPROC )wglGetProcAddress( "glGenFramebuffersEXT" );
			glBindFramebufferEXT = ( PFNGLBINDFRAMEBUFFEREXTPROC )wglGetProcAddress( "glBindFramebufferEXT" );
			glRenderbufferStorageEXT = ( PFNGLRENDERBUFFERSTORAGEEXTPROC )wglGetProcAddress( "glRenderbufferStorageEXT" );
			glFramebufferRenderbufferEXT = ( PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC )wglGetProcAddress( "glFramebufferRenderbufferEXT" );
			glFramebufferTexture2DEXT = ( PFNGLFRAMEBUFFERTEXTURE2DEXTPROC )wglGetProcAddress( "glFramebufferTexture2DEXT" );
This all works perfectly fine on my PC and I don't need to use GLee or anything like that. In either case, Glee or GLew doesn't help on my laptop either. Anyone have any ideas what might be wrong?

Share this post


Link to post
Share on other sites
Advertisement
You can use this free program to see which version of OpenGL your driver supports as well as which extensions:

http://www.realtech-vr.com/glview/download.html

I used it to figure out that my Eee PC doesn't support FBO's no matter which driver I install. :(

Share this post


Link to post
Share on other sites
Can I use a pixel buffer extension as a substitute for a frame buffer? They are essentially the same thing, right?

What options do I have in terms of capping my frame rate to the monitor's refresh rate? On my laptop it simply runs as fast as possible.

Share this post


Link to post
Share on other sites
That's the plan I have as well: to use the pbuffer extension as a fallback if FBOs aren't supported. I haven't really looked all that much into how it works, yet, but from what I understand, it should be a viable substitute for FBOs, just a lot more complicated to use.

Share this post


Link to post
Share on other sites
Note that older Intel drivers (like for GMA 950 and the like) support neither FBOs nor pbuffers, so it's not as if the latter can always work as fallbacks.

GMA 4x00 supports FBOs with the latest drivers (at least on Vista), but they do not support the FBO blit extensions. Try upgrading your drivers.

In general, pbuffers is only useful for pre-2003 hardware with drivers that were never upgraded to support FBOs. My approach is to simply turn off FBO-based effects when either FBO or FBO blit is not support and be done with it. PBuffers are not worth the time spent supporting them.

Share this post


Link to post
Share on other sites
I'm going to run checks in my app for both frame buffer and pixel buffer extensions. If neither are there, then you're just going to have to settle for a choppy game, although that's the price you pay for having an old, crappy computer regardless.

Anyone know of any guides out there for using pixel buffers? I haven't found any yet.

Also, my laptop isn't supporting WGL_EXT_swap_control, are there any other alternatives for setting vsync on/off in my program? If worse comes to worse, then I will settle for manually timing the rendering loop, although that's something I shudder at the thought of. At the moment, my laptop is set to default for no vertical synchronization and there isn't anything I can do about that at the moment. I'm sure there are a lot of other people with my predicament.

Share this post


Link to post
Share on other sites
p-buffers is pretty old. It is from 2000. And it is a mess to use. If you really need to support Intel, then go with Direct3D. You are talking about wglGetSwapIntervalEXT, then I guess you are on Windows.

With Direct3D9, you get their RTT support and much better drivers.
And if you are aiming for casual gamers with their casual laptop with Intel, definitely, go with Direct3D9.

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!