Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 2D / Re: Basic questions on Buffer Strategy, please hel on: 2003-04-27 17:40:50

New Code: I think this block may help your confusion

public void run(){
 while (true){  
    Graphics g = strategy.getDrawGraphics();    
   // Draw to graphics  
   // you have code already in your paint method so take it out
   // and create another method that takes a Graphics g
   // something like
   }catch(InterruptedException e){}

I haven't actually used a Bufferstrategy yet, but from what I've read, this is probably what you want to do.. for a simple render loop.

2  Java Game APIs & Engines / Java 2D / Re: Newbie, summary of research: on: 2003-04-27 17:34:19
Alright, I'll give BufferStrategy a whirl.. I won't delete my other renderers yet though, I'll just plugin a new BufferStrategyRenderer.. and profile my code.. Let's see if suns code "Actually optimizes by choosing the best config" I'm somehow a bit skeptical. I forgot to mention, I'm not using fullscreen mode, so there will be no page flipping in my near future  Cry

Thanks, again for the info.
3  Java Game APIs & Engines / Java 2D / Re: How to remove previous drawStrings? on: 2003-04-27 07:14:46
hey there.. umm basically you need to grab the Graphics2D and execute the following line:

g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR, 0.0f));
Rectangle2D rect = new Rectangle(0,0,m_nBoardWidth,m_nBoardHeight);
// or whatever the size of your screen or rectangle you want to blank to transparent is.
g2D.fill(rect);// now your rectangle has been cleared
after that you have to reset the composite by doing this:


// blit your image or text to the graphics2d now and your done.

4  Java Game APIs & Engines / Java 2D / Re: Newbie, summary of research: on: 2003-04-27 04:58:22
Umm, thanks for the suggestion.. You didn't answer any of my questions though.... Embarrassed
5  Java Game APIs & Engines / Java 2D / Newbie, summary of research: on: 2003-04-27 03:09:00
Hey guys, as you can see by the subject header I'm new to this scene/subculture. I'm currently working on a game engine and I have a couple of questions concerning the hardware acceleration in java. Actually I have more of a summary of the research I've done.

1. Use VolatileImages for the backbuffer. They will blit to the screen faster because java will be moving image data from VRAM to VRAM
2. Use "Managed" images (applet.getImage()) for sprites and blitting to volatile images. Java takes care of the acceleration in the background through the API
3. Use bufferedImages if you need access to pixel data (special effects) slowest of all imges, no hardware acceleration.

Are the three asumptions I've made correct?

Another question:  Currently my engine is setup to auto-detect hardware acceleration. I then load 1 of three renderes according to the following criteria:

1. If the system supports accelerated images and they are true volatileImages then load TrueVolatileRenderer
2. If the system supportts volatile images and they are not true volatile (ie linux.. uses pixelmaps or something) use VolatileRenderer
3. If no accleration can be used use a bufferedImage renderer...

How does the logic sound up there? I divided the renderers up purely for speed... less calcs have to be made if the system is in state 2 then state 3 so I created a differed renderer etc...

Thanks, in advance
Pages: [1]
EgonOlsen (45 views)
2018-06-10 19:43:48

EgonOlsen (27 views)
2018-06-10 19:43:44

EgonOlsen (47 views)
2018-06-10 19:43:20

DesertCoockie (211 views)
2018-05-13 18:23:11

nelsongames (128 views)
2018-04-24 18:15:36

nelsongames (127 views)
2018-04-24 18:14:32

ivj94 (868 views)
2018-03-24 14:47:39

ivj94 (129 views)
2018-03-24 14:46:31

ivj94 (780 views)
2018-03-24 14:43:53

Solater (144 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!