Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


[java] Back Buffer Problems in Java 1.1


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Stiby   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 October 2000 - 09:32 PM

Hi all, First a bit about me, I am a professional multimedia developer who programs in C++ and ASM and currently making the move to Java so my first steps is to get to grips with graphics in Java so I have set myself two tasks one of which is to recreate my simple 3D FlightSim demo over to java in the next week my second challenge is to recreate DOOM or Part of in Java using my ASM/C++ experience to translate and reshape the DOOM engine to a totally OO engine over the next month and a half whilst on training so I will be needing your guys help to achive this goal. My first problem is back buffering in a "Frame" as I find that the code that works for an Applet "createImage( int, int )" dosn''t work in a Buffer it just returns a NULL pointer. What I am ultimatly after is a buffer of some kind that I can adjust and blit similar to DirectX buffers were I can get the surface pointer and render to directly and no ned to re-create the surface to blit the adjustments("g.drawImage(buffer, 0, 0)" or similar). Also working double buffering in a Frame. If you can help it would be most apriciated. Phill Phillip Stiby BSc(HONS) I program therefore cant spell!

Sponsor:

#2 bobbin   Members   -  Reputation: 122

Like
Likes
Like

Posted 18 October 2000 - 12:27 AM

well if i were you i''d use the PixelGrabber to get @ my image source, parse to int[]. Then i could just assume a large array as a buffer and use some of those tryed & tested 86 Asm method logic to wing it through.
createImage won''t work unless you set the content up.

#3 Jerry Lynn   Members   -  Reputation: 122

Like
Likes
Like

Posted 18 October 2000 - 05:40 AM

Rather than use AWT you may want to look into Java 2D which provides better mechanisms for buffering. In the next version Java 2D will even be accelerated on the Windows platform (by hooking into DirectX).

Here is the link to the Java 2D FAQ on Sun''s Javasoft site.

http://www.javasoft.com/products/java-media/2D/forDevelopers/java2dfaq.html

The downside is that your applet will not function in most browsers with out the user having first installed the Java 2 Browser plug-in. If you are planning on eventually building your graphics programs as Java applications this won''t be a problem (as you can distribute the Java Runtime 2.0 with your app). If your goal is to distribute your graphics programs via browser then you will be stuck with AWT.


#4 DJNattyP   Members   -  Reputation: 122

Like
Likes
Like

Posted 18 October 2000 - 07:22 AM

Stiby -

You will want to look at the Toolkit class in your Java documentation. In your frame you can do something like this:


Frame f = new Frame();
Toolkit tk = f.getToolkit();
tk.createImage(...);


There are lots of methods to return an image in there... just choose the appropriate one...

-Nate

#5 Jim_Ross   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 October 2000 - 03:11 AM

Don''t ask me why but you have to do Component.addNotify() before Component.createImage() will work.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS