Jump to content
  • Advertisement

Archived

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

tSG

Can I load texture before Init?

This topic is 6114 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!