PDA

View Full Version : Problem in loading texture bitmap in OpenGL screen saver (win32) programming



mingfai
03-24-2001, 08:34 AM
Help! I can't open texture files when writing a OpenGL screen saver in windows envirnoment. Could anyone tell me how to load bitmap textures in screen saver programming??

Korval
03-24-2001, 09:00 AM
Let's get to the root of the problem. You can't load any textures while running a screen saver. Can you load these textures if you use the same code outside of a screen saver (in a regular app)? And can you load any files while in a screen saver?

Have you checked all of the obvious file issues (is the file there? is the path correct? etc)? And what kind of error are you getting when you attempt to load a texture?

mingfai
03-25-2001, 02:49 AM
Yes, it can load the texture files when it is in exe format. I just wanna to translate my demo into screen saver version. I have also considered using bitmap resource in VC++, but it is diffciult to call the bitmap from the resource and thus convert it into textures. For the path, I just placed the texture file inside "windows\system". I think it is not possible to load it from a file because it seems that the bitmap is embeded in scr files.


Originally posted by Korval:
Let's get to the root of the problem. You can't load any textures while running a screen saver. Can you load these textures if you use the same code outside of a screen saver (in a regular app)? And can you load any files while in a screen saver?

Have you checked all of the obvious file issues (is the file there? is the path correct? etc)? And what kind of error are you getting when you attempt to load a texture?

Don't Disturb
03-25-2001, 03:59 AM
> For the path, I just placed the texture file inside "windows\system"
..which is where the screensaver is I presume (assuming you're just loading "texture.bmp" without specifying any directories).

> I think it is not possible to load it from a file because it seems that the bitmap is embeded in scr files.
You can load any .bmp file you like for the 3d text screensaver, so that's not true.

Put some code into your texture loader that will report any problems (like "Cannot find texture" or "texure is corrupted") then you won't have to do so much guesswork.

mingfai
03-25-2001, 05:25 AM
Yes, I just loaded the file without specifying. Do you think it will load the file from the directory of my scr file ("windows\system")?
I put some reporting code inside, but it still indicates file missing, so where should I place the texture files (or the default loading directory in screen saving mode of windows)?


Originally posted by Don't Disturb:
> For the path, I just placed the texture file inside "windows\system"
..which is where the screensaver is I presume (assuming you're just loading "texture.bmp" without specifying any directories).

> I think it is not possible to load it from a file because it seems that the bitmap is embeded in scr files.
You can load any .bmp file you like for the 3d text screensaver, so that's not true.

Put some code into your texture loader that will report any problems (like "Cannot find texture" or "texure is corrupted") then you won't have to do so much guesswork.