Advertisement Jump to content
Sign in to follow this  

[.net] Marshal.PtrToStringAnsi( Gl.glGetString() ) returns null! Huch?

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

Hello guys! I want to get the the vendor, glVersion, videoCard and extension-list from Tao.
GlExtensionLoader.LoadAllExtensions(); // Load all aviable extensions.

// Get infos:
vendor    = Marshal.PtrToStringAnsi( Gl.glGetString( Gl.GL_VENDOR ) );
glVersion = Marshal.PtrToStringAnsi( Gl.glGetString( Gl.GL_VERSION ) );
videoCard = Marshal.PtrToStringAnsi( Gl.glGetString( Gl.GL_RENDERER ) );

string allExt = Marshal.PtrToStringAnsi( Gl.glGetString( Gl.GL_EXTENSIONS ) );
string[] splitExt = allExt.Split( Char.Parse( " " ) );

// Store the extension list.
for( int i = 0; i < splitExt.Length; i++ )
   extensionList.Add( splitExt );

The problem is that Marshal.PtrToStringAnsi returns null on all 4 attemps! How can I solve this problem? Thank you very much, Riddle. [Edited by - Riddle on May 11, 2005 4:07:47 PM]

Share this post

Link to post
Share on other sites
works fine here...

Are you using sdl? And have you set the videomode before calling glGetString?

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!