   glGetString(GL_EXTENSIONS) returning NULL pointer
  well...the title says much...but not ALL...I was using visual studio professional 2008 (C++) on two machines:PC 1:Win XP SP2, 2GB RAM, any Intel IGP stuffPC 2:Win 7 64-bit, 2GB RAM, ATI Radeon HD4850in PC 1 the glGetString calls works fine...but in PC 2 gets the NULL pointer...so...I've started to think about drivers and such...but then a crazy ideia comes to my mind: "Hey...it's OpenGL...so...It MUST be 'OPEN'"So I've got a GCC compiler (Code::Blocks)...the SAME code...without change a single line...RUNS PERFECTLY! no NULL pointers...any Ideias?here's the piece of code that I'm running.   const char * extensionString=(const char *)glGetString(GL_EXTENSIONS);const char * extensionName="GL_EXT_multi_draw_arrays";if(!extensionString)   return;if(strstr(extensionString,extensionName)!=NULL){EXT_multi_draw_arrays_supported=true;}[Edited by - Pentium166 on April 14, 2010 5:28:23 AM]
  Do you have a valid and correctly created OpenGL rendering context bound when you call glGetString? If not, it will return NULL.   ;  It is...If it wasn't, even on GCC it'll get NULL, right?   ;  Does calling glGetError after glGetString reveal anything usefull?Best way to tell if the context is valid is to draw s.th. onto the screen :-)Also, calling from a different thread can be a source for invalid contexts, as the OGL context is bound to the thread initializing the context, though I doubt this is an issue in your case.Quote:So I've got a GCC compilerGCC Compiler as in MinGW using the same OS (Win 7, same drivers, etc), or vanilla GCC on linux?Also do you build 64-Bit binaries with both compilers? Not sure about win, but on linux a program can only link to a shared object file (== DLL) of the same type (32 bit program with 32 bit lib or 64 bit program with 64 bit lib).Maybe C::B builds a 32 bit binary which gets linked to an existing/valid 32 bit OpenGL implementation whereas VS builds a 64 bit binary which gets linked to something completely different or non existent.   ;Quote:Original post by Ohforf sakeDoes calling glGetError after glGetString reveal anything usefull?hmmm...I'll try that one...Best way to tell if the context is valid is to draw s.th. onto the screen :-)Also, calling from a different thread can be a source for invalid contexts, as the OGL context is bound to the thread initializing the context, though I doubt this is an issue in your case.Quote:GCC Compiler as in MinGW using the same OS (Win 7, same drivers, etc), or vanilla GCC on linux?MinGW...and C::B works on both machines...Quote:Also do you build 64-Bit binaries with both compilers? Not sure about win, but on linux a program can only link to a shared object file (== DLL) of the same type (32 bit program with 32 bit lib or 64 bit program with 64 bit lib).Maybe C::B builds a 32 bit binary which gets linked to an existing/valid 32 bit OpenGL implementation whereas VS builds a 64 bit binary which gets linked to something completely different or non existent.now that's something!I'll do the tests about it...but I don't know if it's relevant but I've got the same 32bit SDL from both VS and GCC (because I started this program in a WinXP machine) and I'm still using this stuff...so I don't know that even the glGetString being a native command gets any interference from who starts the OGL window. ;  Well I've some news about my problem and that may help some of then.In fact, the error was because the OpenGL isn't loading...So I've go deep into the code to check what is it (since I was using the "SDL_OPENGL" parameter) and to my surprise...the SDL_OPENGL was defined in hex as 0x00000002 (2...I supose) but when I got into out of VC app and get the SDL code debugged it became a number an abusrd number...to try to solve it I've used this piece of codeQuote:/** Pentium166's VC2008 for SDL_SetVideoMode() *//*@{*/#define SDL_OPENGLVC92 /**< Create an OpenGL rendering context */#define SDL_FULLSCREENVC92147483648#define SDL_DOUBLEBUFVC91073741824#define SDL_NOFRAMEVC932#define SDL_RESIZEBLEVC916So, I replaced the SDL_OPENGL to SDL_OPENGLVC9 and THE MAGIC HAPPENED!!!! The glGetString worked perfectly.But before I could celebrate my victory about the vicious binary force...I have remember the basic...almost ALL DEFINES in SDL was like this...(errors in controls specially)so...anyone has any ideia what the hex numbers are coming messed up? (any config to put on VC)(btw: sorry about my bad english)[Edited by - Pentium166 on April 14, 2010 8:24:16 AM]