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 » Form with OpenGL Display object
Form with OpenGL Display object [message #35922] Tue, 03 April 2012 22:58 Go to next message
Antin_Kravs is currently offline  Antin_Kravs
Messages: 1
Registered: April 2012
Location: UA
Junior Member
Hi Embarassed ) I wan't to lern U++, i alredy know smth. about console C++, but now i'm realy don`t want to work with C# or .NET, and in my University i must do some task using OpenGL. How can i make program like this using Upp:


http://cs11132.userapi.com/u12202165/135245769/y_1d4f55eb.jpg

I mean just how to put Display into form,and controll it using buttons) how to draw image using OpenGL i know)
I saw some Examples, but without forms)
thnx for reading)
Sory for bad Eng. Smile
Re: Form with OpenGL Display object [message #36161 is a reply to message #35922] Tue, 08 May 2012 09:21 Go to previous message
navi is currently offline  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.
Previous Topic: How to add "GLEW" or "GLee" to GLCtrl?
Next Topic: array of function pointer
Goto Forum:
  


Current Time: Sun Apr 28 14:30:07 CEST 2024

Total time taken to generate the page: 0.02948 seconds