   How to render while data loads...??
  i am having trouble being able to execute any openGL code while i load data through a GUI. i have a menu that i can sort through that i wrote and the final option will load the data accordingly. i would like to render a rotating logo of some sort to indicate that the data is loading but it seems that i can do nothing until the data is loaded. i have even tried to render before the function to load the data is called but no such luck. i hope that everyone understands my problem.. thanks for your help!   
  If you break up the loading process into steps, you can render in-between.   ;  You either break up the load process as mentioned or implment asynchronous loading in a seperate thread, and your main thread can spin in a render loop while the loading thread does it's thing.   ;Quote:Original post by DrEvilYou either break up the load process as mentioned or implment asynchronous loading in a seperate thread, and your main thread can spin in a render loop while the loading thread does it's thing.how would you go about breaking up the load process? i figured i would need something of the sort, just have never needed to do it before..thanks!oh yeah i could use pthread in linux after researching but as a fly in the ointment i need something cross platform that would work in windows and linux.   ;  Well, a simple method may be to update your load screen in between loading each asset. It won't be perfectly smooth but it would be better than freezing for the whole time. Assuming you have a collection of meshes, textures, etc, add the capability to poll your load screen in between the loading of each individual asset. Maybe a generic callback could be invoked LoadState::OnResourceStartLoading(const std::string &_resourcename);LoadState::OnResourceDoneLoading(const std::string &_resourcename);Within these callbacks you can simply animate a load graphic, or optionally display text for each asset that is loading. This is useful for debugging or visualizing what assets are taking the most time.This won't give you a silky smooth load process, only threading can do that well, unless you go down to a very low level into your loading code, and for example your file IO class reads files in blocks and has the capability to poll a callback as well between each block read.Threading it is less intrusive and easier in many ways, but be careful, because often there are issues with creating graphics objects from a seperate thread(at least with d3d there was, never tried with opengl).   ;Quote:Original post by DrEvilWell, a simple method may be to update your load screen in between loading each asset. It won't be perfectly smooth but it would be better than freezing for the whole time. Assuming you have a collection of meshes, textures, etc, add the capability to poll your load screen in between the loading of each individual asset. Maybe a generic callback could be invoked LoadState::OnResourceStartLoading(const std::string &_resourcename);LoadState::OnResourceDoneLoading(const std::string &_resourcename);Within these callbacks you can simply animate a load graphic, or optionally display text for each asset that is loading. This is useful for debugging or visualizing what assets are taking the most time.This won't give you a silky smooth load process, only threading can do that well, unless you go down to a very low level into your loading code, and for example your file IO class reads files in blocks and has the capability to poll a callback as well between each block read.Threading it is less intrusive and easier in many ways, but be careful, because often there are issues with creating graphics objects from a seperate thread(at least with d3d there was, never tried with opengl).well right now i am not able to do ANYTHING while the data loads. i have even tried to disable the GUI(in ortho mode) by a key press while loading and nothing happens until after the data is finished loading. MSDN doesnt seem to be much help either on creating and deleting threads in windows. it wants you to use namespace System which when i compile says that this namespace doesnt exist. ;Quote:Original post by OpenGL_GuruMSDN doesnt seem to be much help either on creating and deleting threads in windows. it wants you to use namespace System which when i compile says that this namespace doesnt exist.you're looking at the threading api for .net. what language(s) and api(s) are you using besides opengl?   ;Quote:Original post by gumpy macdrunkenQuote:Original post by OpenGL_GuruMSDN doesnt seem to be much help either on creating and deleting threads in windows. it wants you to use namespace System which when i compile says that this namespace doesnt exist.you're looking at the threading api for .net. what language(s) and api(s) are you using besides opengl?C++ using .NET 2003 Standard & of course openGL (and glut)   ;  I haven't read this MSJ article in a few years so I forget how good it is, but may be a start for you.   ;  If you don't want to work with threads, you can always try Overlapped I/O.  For example, ReadFileEx calls a callback function when the transfer has completed.