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 » OpenGL example
OpenGL example [message #27355] Wed, 14 July 2010 09:42 Go to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Hi,

I have examined the OpenGL example and I have some questions, which I show here. I will be grateful if someone answers them:

1.- The examples uses GLCtrl struc; where in the manual is this widget described?
2.- I seen that the “typical” code chunk for allowing correct window resizing is not needed (not used); does this means that somehow this code is built in within GLCtrl class?
Note: I am referring to the typical “reshape” function.
3.- It seems that when the window is resized a nasty flicker happens; how this can be eliminated?
4.- How the different releases of Open can be selected? For instance, if I decide to use the reseal 3.1, how can I select it?

Many thanks and my best wishes.

Javier
Re: OpenGL example [message #27357 is a reply to message #27355] Wed, 14 July 2010 12:17 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
1. GLCtrl is undocumented, it's not really a core component of Upp. But it doesn't do anything too complicated, just creates a GL context bound to a native window (normally Upp ctrls aren't attached to native windows)
2. GLCtrl::StdView() contains the viewport definition code. In the example this is called in GLPaint, though you would normally override GLResize() and call it there.
3. Remove the line Ctrl::GlobalBackPaint() from the Main function in main.cpp. I don't know why that line is there, it's clearly incorrect.
4. The version of OpenGL you use is just which extensions you use. The version of you GL libs is defined somewhere in gl.h. I'd recommend using Glew if you want to use extensions, it makes it much easier.

The GLCtrl is really just a starting point, if you want to do anything serious you will need to modify it considerably. One thing that you will probably need is a public method to activate the drawing context since in a GUI app things like opening a Prompt window can change the context. You will also want your own viewport/perspective code and a whole lot of other stuff.

[Updated on: Wed, 14 July 2010 12:18]

Report message to a moderator

Re: OpenGL example [message #27481 is a reply to message #27355] Tue, 20 July 2010 10:33 Go to previous message
andykim is currently offline  andykim
Messages: 1
Registered: July 2010
Location: singapore
Junior Member
Thank you for your great question and answer. They're really useful for a newbie like me Razz
Previous Topic: Conceptual Query: widget functions access
Next Topic: Implementation of ColorPopUp ctrl
Goto Forum:
  


Current Time: Tue Apr 23 13:49:23 CEST 2024

Total time taken to generate the page: 0.02234 seconds