[…]
This is possibly a bug in your OpenGL implementation.
Please send a complete minimal example. I can’t reproduce this error (using
Mesa 6.2.1).
Which platform and which graphics driver do you use?
Platform: WinXP
Compiler: MinGW/GCC
Development-Environment: Eclipse/CDT
Graphics: Ati Mobility Radeon 9600 Pro, Driverversion: 6.14.10.6392
(30.10.2003)
(Problem also exists on other Notebooks/Displays)
SDL-Version: 1.2.5
Libraries linked: SDL, SDL_image, SDL_net, glut32, glu32, opengl32
=== code ===
#include “…/contrib/SDL/include/SDL.h”
#include “…/contrib/SDL/include/SDL_net.h”
#include “…/contrib/SDL/include/SDL_opengl.h”
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#ifdef _WIN32
#undef main
#endif
int main(int argc, char *argv[]) {
if (SDL_Init(SDL_INIT_VIDEO)<0) {
fprintf( stderr, “Video initialization failed: %s\n”, SDL_GetError());
SDL_Quit();
}
atexit(SDL_Quit);
SDL_SetVideoMode(1024, 768, 32, SDL_OPENGL);
while (true) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glViewport(0, 0, 1024, 786);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, 1024, 0, 786);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.375f, 0.375f, 0.0f);
glColor3f(1, 1, 1);
glBegin(GL_LINES);
glVertex2i(100, 100);
glVertex2i(200, 100);
glVertex2i(200, 100);
glVertex2i(200, 200);
glVertex2i(200, 200);
glVertex2i(100, 200);
glVertex2i(100, 200);
glVertex2i(100, 100);
glEnd();
glBegin(GL_LINE_STRIP);
glVertex2i(350, 350);
glVertex2i(400, 350);
glVertex2i(400, 400);
glVertex2i(350, 400);
glVertex2i(350, 350);
glVertex2i(400, 350);
glEnd();
glPolygonMode(GL_FRONT, GL_LINE);
glBegin(GL_QUADS);
glVertex2i(100, 300);
glVertex2i(150, 300);
glVertex2i(150, 350);
glVertex2i(100, 350);
glEnd();
glPolygonMode(GL_FRONT, GL_FILL);
SDL_GL_SwapBuffers();
SDL_Event event;
SDL_PollEvent(&event);
SDL_Delay(200);
}
SDL_Quit();
return 0;
}
=== /code ===
Florian Liefers