• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Why doesn't it work?!

## Recommended Posts

Why does this return NULL: (PFNGLGETOBJECTPARAMETERFVARBPROC) wglGetProcAddress("glGetObjectParameterfvARB") ??? I have the latest ATi drivers installed and I''ve a Radeon9600pro.
"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

##### Share on other sites
First determine if the feature is available through glGetString(GL_EXTENSIONS).

##### Share on other sites
And if it still returns 0, make sure the rendering context is active.

##### Share on other sites
you dont happen to have upgraded your drivers recently? i remember problems with some extension loading libs and a lot of wasted time til i realized desktop is set to 16bit and without even getting the right pixelformat its no surprise if nothing else is working.

##### Share on other sites
The extensions are supported of course, I''m getting the right pixel format and the rendering context is active.
Should wglGetProcAddress("glGetObjectParameterfvARB") return a valid pointer? Is the string ok?

"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

##### Share on other sites
I''M GOING TO.... I DON''T KNOW WHAT I''M GOING TO DO!!! SOMEONE, SOMETHING IS GOING TO DIE A HORRIBLE SLOW DEATH!!! I HAVEN''T DONE SUCH A STUPID MISTAKE FOR GOD DAMMIT 3 YEARS AT LEAST!!! JUST LOOK AT THIS:
if ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC) wglGetProcAddress("glGetObjectParameterfvARB"))==NULL); 		return false;

SEE IT? GOOD, BECAUSE I DIDN''T SEE IT FOR 1 F^\$KING HOUR!!!

Ahh, now it is better.

"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

##### Share on other sites
glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC) wglGetProcAddress("glGetObjectParameterfvARB");if (glGetObjectParameterfvARB==NULL); 		return false;

You could have caught the error in a few seconds with a debugger if you hadn''t been doing several things in a single line.

##### Share on other sites
quote:
Original post by Brother Bob
glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC) wglGetProcAddress("glGetObjectParameterfvARB");if (glGetObjectParameterfvARB==NULL); 		return false;

You could have caught the error in a few seconds with a debugger if you hadn''t been doing several things in a single line.

Ah well, I guess you are right.. But that doesn''t mean I won''t do several things in a line!!

"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

##### Share on other sites
teehee, 3 years and you make a mistake like that?

I apologise, but take your time to try and not fit so much in one line.

Stay Clausal,

Red Sodium

##### Share on other sites
quote:
Original post by red_sodium
teehee, 3 years and you make a mistake like that?

I apologise, but take your time to try and not fit so much in one line.

Stay Clausal,

Red Sodium

Hey, I have been programming in C++ for more than 3 years, it just I copy pasted all those declarations and used replace to modify all that code to fit. That GLSL has around 20+ functions..

"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

##### Share on other sites
quote:
Original post by Brother Bob
glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC) wglGetProcAddress("glGetObjectParameterfvARB");if (glGetObjectParameterfvARB==NULL); 		return false;

You could have caught the error in a few seconds with a debugger if you hadn''t been doing several things in a single line.

I always put braces {} around my if blocks, even if they''re only one line...because it''s so easy to do something stupid like:

if(someErrorOccurred)   printf("oops");

But then you add, say, an automatic logger, and so you have now:
if(someErrorOccurred)   printf("oops");   LogError(someError); /*oh crap!*/

which can screw you over if you don''t pay attention

• ### Forum Statistics

• Total Topics
627714
• Total Posts
2978775

• 9
• 21
• 14
• 12
• 42