Home » Community » Newbie corner » Form with OpenGL Display object
|
Re: Form with OpenGL Display object [message #36161 is a reply to message #35922] |
Tue, 08 May 2012 09:21 |
navi
Messages: 107 Registered: February 2012 Location: Sydney, Australia
|
Experienced Member |
|
|
As I understand it you can create a new CtrlLib application from the “Project Assembly” dialog.
Then add the GLCtrl to you project using the “Package organizer” dialog.
Then add #include <GLCtrl/GLCtrl.h> in main.cpp of your project.
Then write your derive your class using the GLCtrl class and override the following method
// Overridable methods for derived controls
// Called after succesful OpenGL initialization
virtual void GLInit();
// Called just before OpenGL termination
virtual void GLDone();
// Called on resize events
virtual void GLResize(int w, int h);
// Called on paint events
virtual void GLPaint();
Once you have your GL class ready, you can add your GL class and other widgets like buttons and stuff from CtrlCore into your windows using the win.Add() function like below.
GUI_APP_MAIN{
TopWindow win;
MyGL gl;
win.Add(gl.LeftPos(10, 700).TopPos(10, 700));
win.Sizeable().Zoomable();
win.Open();
win.Run();
}
See the attachment in this post. In that package I did something similar, but haven't add the widgets yet. Still working through my GL codes.
|
|
|
Goto Forum:
Current Time: Wed Jun 05 10:11:10 CEST 2024
Total time taken to generate the page: 0.01419 seconds
|