Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Problem with OpenGL functionality: glPrimitiveRestartIndex
Problem with OpenGL functionality: glPrimitiveRestartIndex [message #27503] Wed, 21 July 2010 13:53 Go to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Hi,

I am trying to use OpenGL function glPrimitiveRestartIndex, however the application crashes. I am enclosing a simple example, so an expert in OpenGL might answer this query.

Thanks. Cheers,

Javier.
Re: Problem with OpenGL functionality: glPrimitiveRestartIndex [message #27506 is a reply to message #27503] Wed, 21 July 2010 14:26 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Your example doensn't compile becasue you haven't included Glew.

Have you tried removing the restart index and drawing the 6 indices with GL_TRIANGLES?
Re: Problem with OpenGL functionality: glPrimitiveRestartIndex [message #27508 is a reply to message #27506] Wed, 21 July 2010 14:53 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Hi,

I have found the cause of the error: my graphic card does not support OpenGL version beyond 2.1, and the function glPrimitiveRestartIndex was implemented in OpenGL 3.1.

Yes, Glew is included (I have modified GLCtrl to have Glew).

It is a pity for I need these functions to facilitate the geometry generation.

Thanks,

Javier
Re: Problem with OpenGL functionality: glPrimitiveRestartIndex [message #27510 is a reply to message #27508] Wed, 21 July 2010 15:05 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Just break your polygons down into triangles and draw those instead. It requires 0 extra vertices and (n-3)*2 extra indices (where n is the number of points in the polygon).

Unless you're planning on drawing millions of textured and shaded triangles a frame you won't notice any difference at all.

[Updated on: Wed, 21 July 2010 16:30]

Report message to a moderator

Re: Problem with OpenGL functionality: glPrimitiveRestartIndex [message #27522 is a reply to message #27510] Wed, 21 July 2010 23:01 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Javier and mrjt

It seems you know rather OpenGL.

Would it be possible to do some simple eye candy OpenGL example richer than the one we have? (sorry Daniel, it is just eye candy Smile)

Perhaps we could convince Mirek to upload it Smile.


Best regards
Iñaki
Re: Problem with OpenGL functionality: glPrimitiveRestartIndex [message #27534 is a reply to message #27522] Thu, 22 July 2010 11:02 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I'm not sure what purpose this would serve really. The OpenGL example isn't designed to teach OpenGL, there are plenty of other resources for that, but how to set up a window for GL painting in UPP. It's like Tutorial 01 on NeHe, the absolute beginning.

Besides that, making anything more complicated quickly involves using other resources like textures and extensions that are well beyond the scope of the example. I think the current one is pretty good really, the only thing that could use improvement is the GLCtrl itself.

[Updated on: Thu, 22 July 2010 11:04]

Report message to a moderator

Re: Problem with OpenGL functionality: glPrimitiveRestartIndex [message #27537 is a reply to message #27503] Thu, 22 July 2010 11:36 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
+1 mrjt.

If you want something more candy, I would do it as OGL demo 2, the question is what does it have with UPP, as UPP generally doesn't support OGL in any way except not getting into it's way. Wink

Thinking about it, probably a demo showing different ways how to mix UPP GUI (Ctrls? Events? Etc?) with OGL and some stuff like MT with timers, animations, background loading, i.e. where upp classes may help... that may be of considerable value. Still the OGL part is not important technically, so making it overly complex would maybe hurt more then help.

If you want true eye candy, just do OGL demo and put it into forum and Applications here on web, but I wouldn't add it to bazaar.
Re: Problem with OpenGL functionality: glPrimitiveRestartIndex [message #27539 is a reply to message #27537] Thu, 22 July 2010 12:04 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Things that would be most useful:
Loading textures using StreamRaster/Image (there are a couple on non-obvious steps involved)
A Glew package
A GL example with multiple windows/more complex behaviour

I've most of this code already and a whole set of util classes (like a texture loader that works with ref-counted Texture objects for example) that I'll happily post to bazaar if someone wants them.

The thing is that you have to be a bit mad to try and do anything in OpenGL from the ground up these days. After the last time I did it (in UPP) I vowed I'd never do it again. Almost as soon as you get past 'Hello World' you want to be using an SDK like Ogre3D or you're just re-inventing the wheel.

Now, an Ogre3D port to Upp without all the hideous pointers and bizarre memory management is something I could really get behind Smile
Re: Problem with OpenGL functionality: glPrimitiveRestartIndex [message #27542 is a reply to message #27539] Thu, 22 July 2010 13:20 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
mrjt wrote on Thu, 22 July 2010 12:04

Things that would be most useful:
Loading textures using StreamRaster/Image (there are a couple on non-obvious steps involved)
A Glew package
A GL example with multiple windows/more complex behaviour

I've most of this code already and a whole set of util classes (like a texture loader that works with ref-counted Texture objects for example) that I'll happily post to bazaar if someone wants them.

The thing is that you have to be a bit mad to try and do anything in OpenGL from the ground up these days. After the last time I did it (in UPP) I vowed I'd never do it again. Almost as soon as you get past 'Hello World' you want to be using an SDK like Ogre3D or you're just re-inventing the wheel.

Now, an Ogre3D port to Upp without all the hideous pointers and bizarre memory management is something I could really get behind Smile


Ogre in U++ would be nice Smile


Best regards
Iñaki
Previous Topic: Implementation of ColorPopUp ctrl
Next Topic: Custom Control
Goto Forum:
  


Current Time: Thu Mar 28 22:15:50 CET 2024

Total time taken to generate the page: 0.01921 seconds