Home » U++ Library support » U++ Library : Other (not classified elsewhere) » [DEPRECTED] GLDrawDemo - Resizing dosen't work.
[DEPRECTED] GLDrawDemo - Resizing dosen't work. [message #42251] |
Sat, 01 March 2014 23:48 |
|
Klugier
Messages: 1085 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
It seems that resizing in GLDrawDemo dosen't work properly.
The first worse solution is just to add explicit glVieport invocation in GLPaint() method(GLDrawDemo - main.cpp - Line 10):
virtual void GLPaint() {
Size sz = GetSize();
glViewport(0, 0, (GLsizei)sz.cx, (GLsizei)sz.cy); // <- We need to add this line
...
}
The second much complex solution is to extends a little bit GLCtrl. I think that Layout method should call glVieport function by default. Below is a proposal of my code (beta version):
void GLCtrl::Layout() {
if(controlVieport) { // <- Additional flag, enable by default
Size sz = GetSize();
glViewport(0, 0, (GLsizei)sz.cx, (GLsizei)sz.cy);
}
Ctrl::Layout();
}
Please review above proposition.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Thu, 13 March 2014 17:09] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Dec 13 23:34:02 CET 2024
Total time taken to generate the page: 0.04089 seconds
|