
Originally Posted by
wysota
Intel HD OpenGL drivers for Windows are totally broken. You should focus on getting your NVidia drivers to work properly. I'm sure the code of the program itself is correct, it works fine on my Linux+NVidia combo.
01:00.0 VGA compatible controller: NVIDIA Corporation GF104 [GeForce GTX 460] (rev a1)
I'd be thankful if you have any instructions/hints regarding this. I remember trying to install the NVidia driver before any Intel HD driver resulting in some message like "You must install Intel HD first [...]" or something along those lines. I also remember uninstalling Intel HD leaving me with a black screen once, requiring me to reinstall Windows - so I'm paranoid about ever touching it again. I still need to test if there are painting problems when doing updateGL() outside the content of a resize event. If yes, I won't be using OGL for anything, because there are too many people with systems like mine. If no, crappy resizing performance is an endurable pain.

Originally Posted by
norobro
If I may interject . . .
@Zyl - I see similar artifacts using your code above on my Debian box. Try calling
glClear() in your
paintGL() function:
void paintGL() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
. . .
void paintGL() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
. . .
To copy to clipboard, switch view to plain text mode
Good idea. glClear does the job. Actually... If I don't do glClear, everything still gets cleared with black. At least when I move my squares like so:
glBegin(GL_QUADS);
glVertex2i(10 + (20 * i), 10 + (20 * j) + 3 * (countPaint % 150));
glVertex2i(20 + (20 * i), 10 + (20 * j) + 3 * (countPaint % 150));
glVertex2i(20 + (20 * i), 20 + (20 * j) + 3 * (countPaint % 150));
glVertex2i(10 + (20 * i), 20 + (20 * j) + 3 * (countPaint % 150));
glEnd();
glBegin(GL_QUADS);
glVertex2i(10 + (20 * i), 10 + (20 * j) + 3 * (countPaint % 150));
glVertex2i(20 + (20 * i), 10 + (20 * j) + 3 * (countPaint % 150));
glVertex2i(20 + (20 * i), 20 + (20 * j) + 3 * (countPaint % 150));
glVertex2i(10 + (20 * i), 20 + (20 * j) + 3 * (countPaint % 150));
glEnd();
To copy to clipboard, switch view to plain text mode
; the previously drawn ones won't stay visible in the next frame. I'm no OGL expert, but isn't this supposed to not happen unless there actually is a glClear()-call?
Another thing I noticed: I seem to be able to avoid unneccesary drawing by doing this:
void initializeGL() {
// gl-calls here
resized = true;
}
void resizeGL(int w, int h) {
// gl-calls here
resized = true;
}
void paintGL() {
if (!resized)
return;
// gl-calls to draw here...
resized = false;
}
private:
bool resized;
void initializeGL() {
// gl-calls here
resized = true;
}
void resizeGL(int w, int h) {
// gl-calls here
resized = true;
}
void paintGL() {
if (!resized)
return;
// gl-calls to draw here...
resized = false;
}
private:
bool resized;
To copy to clipboard, switch view to plain text mode
; this seemingly effectively increases performance and responsiveness.
EDIT: Doing this running the program using NVidia GPU however causes a black window. The squares would only flash up while resizing it.
Bookmarks