ok, i did everything you suggested, and i get a window to pop up, but nothing gets drawn into it. i know im creating a context, and i also know that it is the current one. the weird thing is, the color that the window is filled with matches my glClearColor, so some gl commands are drawing to the window, but things like vertex calls arent. here is my window initialization code (getVisual is just a copy of what you posted earlier):
Display * disp;
Window xWin;
XEvent event;
XVisualInfo * vInfo;
XSetWindowAttributes swa;
GLXContext context;
int swaMask;
Uint32 first, second;
disp = XOpenDisplay(0);
if(disp == NULL)
{
fprintf(stderr, "cant open display");
}
vInfo=getVisual(disp);
if(vInfo == NULL)
{
fprintf(stderr, "cant get visual");
}
swa.border_pixel=0;
swa.event_mask = StructureNotifyMask | KeyPressMask;
swa.colormap = XCreateColormap(disp, RootWindow(disp, vInfo->screen), vInfo->visual, AllocNone);
swaMask = CWBorderPixel | CWColormap | CWEventMask;
xWin = XCreateWindow(disp, RootWindow(disp, vInfo->screen), 0, 0, 800, 600, 0, vInfo->depth, InputOutput, vInfo->visual, swaMask, &swa);
// XSelectInput(disp, xWin, StructureNotifyMask);
context = glXCreateContext(disp, vInfo, NULL, True);
glXMakeCurrent(disp, xWin, context);
XMapWindow(disp, xWin);
XWindowEvent(disp, xWin, StructureNotifyMask, &event);
while(1)
{
XCheckWindowEvent(disp, xWin, StructureNotifyMask | KeyPressMask, &event);
DrawGL();
glXSwapBuffers(disp, xWin);
}
i know that what is in DrawGL() works, because it did draw things when i used SDL. thanks for any help, this is really bugging me.