Archived

This topic is now archived and is closed to further replies.

tSG

Can I load texture before Init?

Recommended Posts

Can I load and use textures (glBindTexture) before I have any opengl windows? Cause'' I would like to load the textures before the demo, while it has the "loading" window. -- tSG --

Share this post


Link to post
Share on other sites
At the moment it would be very painful job. Then I think I''ll make the gl window, but hide it, and show the loading window.
Thanks


-- tSG --

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What are you trying to do exactly? You said you want to load the textures while showing a progress indicator right? Well then, what is the problem? You have a window showing "loading" already, so you can do whatever you want.


Share this post


Link to post
Share on other sites
No, i don''t need an indicator. I would like to show an another window with a bitmap while loading the scene.
The steps are:
1. a window with a big ''Loading'' text
2. a new window in which I can render


-- tSG --

Share this post


Link to post
Share on other sites
I pretty sure you can. The state of the graphics card is independent of that of Windows windows (If that makes any sense) ).

Share this post


Link to post
Share on other sites
Why not show the loading texture in the main window? Load that texture first, display it, then load the rest

Share this post


Link to post
Share on other sites
Fruny: thanks, that''s what I wanted to hear
Shag: I could do that, but a ''loading'' window is easier to implement; it doesn''t require so "much" coding than making such a loader...


-- tSG --

Share this post


Link to post
Share on other sites
You can not load textures into the OpenGL sub-system before you''ve initialised it (ie got a rendering context)...however it''s not exactly difficult to do what Shag suggested:

  
// Do a basic init on OpenGL including enabling textures;

// Load ''Loading'' Texture;

// Render the ''Loading'' texture to the screen;

renderLoadingScreen();
for(i=0; i<nTextures; i) {
loadTexture(i, pFileName[i]);
};

// Finish OpenGL init for nice things like lights, materials & gl extentions;




If you wanted to do a status bar, why not just have a rendering function for the screen that renders the texture onto a quad, and then switches to an untextured quad & renders a box (whose length depends on the % completion) on top of the first quad ?

Regards

NickB

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Most of us are saying why do you need 2 windows? Just open 1 window, and slap down the loading text. Then you can load whatever you want.

As stated above:

initwindow()
PrintLoadingMessage()
LoadTextures()
LoadSound()
DoWhateverYouWant()


And that is it.

Share this post


Link to post
Share on other sites