Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (604)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Background Loading  (Read 1319 times)
0 Members and 1 Guest are viewing this topic.
Offline cborders

Junior Devvie





« Posted 2005-12-10 05:01:43 »

I just thought of this and wondered if it was possible.  If I had an OpenGL context that was shared between a Display and a Pbuffer, could I load data into the Pbuffer in the background while using the Display to render.  That way, if I had a large open world I could load data that was getting close enough to see, so that it would be in memory once I got close enough to see it.  Like I said I don't know if this would work and it's rather late so if I'm talking crazy, just let me know!
Offline princec

« JGO Spiffy Duke »


Medals: 439
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2005-12-12 00:25:47 »

You forget that only one thread can own the context at a time...

Cas Smiley

Offline cborders

Junior Devvie





« Reply #2 - Posted 2005-12-12 01:45:21 »

 Roll Eyes Oh, yeah
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 439
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2005-12-12 11:53:17 »

The way I've got it rigged is you can have a separate resource loading thread that loads stuff from disk into ByteBuffers. But then what it does is queue GL code up in the main thread so that I don't need to do any fiddly thread context switching. It's still fiddly and I've not really used it in anger. Er, or at all, even. The main problem being it's usually quite difficult to know what you need to load next until the time comes when you actually need to display it. Especially as some things need to be loaded with dependencies - consider loading a GL model for example, it'll have to bring in a bunch of textures asynchronously as well, etc, etc.

I find it generally just easier to load everything on demand and as much as feasible up front during the splash screen Smiley

Cas Smiley

Offline kevglass

« JGO Spiffy Duke »


Medals: 221
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #4 - Posted 2005-12-12 12:02:22 »

I use this sorta thing

http://www.cokeandcode.com/code/src/render/org/newdawn/state/loading/
http://www.cokeandcode.com/code/src/render/org/newdawn/state/

which just queues up a bunch of little tasks  that need loading and loads one per frame. It doesn't make it perfect, but it does give a slightly better refresh at spash screen / load time

Didn't Weston have a wonderfully threaded texture loader in the Shared Code section at one point?

Kev

Offline princec

« JGO Spiffy Duke »


Medals: 439
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2005-12-12 12:58:49 »

You can do it in SPGL with another thread if you like but as you've noticed from the applet framework the splash screen is synchronous and just uses a callback to paint the progress bar Wink

Cas Smiley

Offline g666

Junior Devvie





« Reply #6 - Posted 2005-12-12 21:01:14 »

I guess loading while displaying an animation would be pointless as it would just make the loading slower. although if stuff could be loaded while the menu screen is showing then that could get rid of menu-game load times.

desperately seeking sanity
Offline princec

« JGO Spiffy Duke »


Medals: 439
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #7 - Posted 2005-12-12 23:19:22 »

Well, it has it's place in user interface design: the user should never be left waiting for something without feedback if it's going to take more than a second or two.

Cas Smiley

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (8 views)
2014-12-27 22:38:51

Mr.CodeIt (13 views)
2014-12-27 04:03:04

TheDudeFromCI (17 views)
2014-12-27 02:14:49

Mr.CodeIt (25 views)
2014-12-23 03:34:11

rwatson462 (56 views)
2014-12-15 09:26:44

Mr.CodeIt (46 views)
2014-12-14 19:50:38

BurntPizza (92 views)
2014-12-09 22:41:13

BurntPizza (113 views)
2014-12-08 04:46:31

JscottyBieshaar (86 views)
2014-12-05 12:39:02

SHC (97 views)
2014-12-03 16:27:13
How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!