Skip to main content
GameDev.net gamedev.net
🔒 Locked

Very Simple Code Stopped Working :-(

Started by leiavoia Jul 13, 2004 at 11:17 PM 5 replies 900+ views
Original Post
leiavoia
leiavoia
I just switched me dev system over from Mandrake 9.1 Linux to Debain/GNU Linux. I got my program to compile but nothing shows up on the screen. It would seem that OpenGL is not giving me textures or reserving memory like i want. It used to compile, but sinced i switched systems, it just displays black. Please look at this very simple bit of code:

GLuint texture = 555; // dummy number - should get overwritten

glGenTextures( 1, &texture );
std::cout << "Generated texture index: " << (int)texture << std::endl;

glGenTextures( 1, &texture );
std::cout << "Generated texture index: " << (int)texture << std::endl;

glGenTextures( 1, &texture );
std::cout << "Generated texture index: " << (int)texture << std::endl;

glGenTextures( 1, &texture );
std::cout << "Generated texture index: " << (int)texture << std::endl;

This should print: 1 2 3 4 but instead prints: 555 555 555 555 Can you think of anything that would cause this behaviour? I'm stumped.
Myopic Rhino
Myopic Rhino
This seems like something that would happen if you don't have a valid context. Other than that, try calling glGetError().
leiavoia
leiavoia
What specifically do you mean by valid context? glGetError only returns zero. The weird thing is that, like i said, i haven't actually changed the code any.
leiavoia
leiavoia
UPDATE:

Just to make it even weirder, i have some old NeHe tutorials that were compiled on my old system. They work fine right off the binaries. But if i try to delete them and recompile, they just throw a blank screen. Weird!
joanusdmentia
joanusdmentia
Try reinstalling your graphics card drivers and see if that helps.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The nly verdict is vengeance; a vendett o
leiavoia
leiavoia
i reinstalled the drivers and it worked. I have no idea why, but it did.

thanks.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.