Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / December 2003

Tip: Looking for answers? Try searching our database.

Fast 2D blitting and frame buffering

Thread view: 
Andrew Crowe - 29 Nov 2003 21:27 GMT
Hi guys,

After looking at the different Java lists I figured that 3D stuff has
most in common with what I'm trying to do.

I'd like to create a 2D graphics engine by writing all the graphics to a
simple memory buffer (an array of 24 bit pixels) then blitting the
result to the screen display.

However I haven't been able to find any information on doing this (I'm
guessing there's a faster way to do it then plotting pixels using the
built in 2d graphics class).

Also what's the best datatype for the frame buffers (and the
tiles/sprites graphics) is it a byte array, or something else (like a
bitset?)

Any help much appreciated

Thanks

Andrew
Sascha Ledinsky - 12 Dec 2003 16:00 GMT
try a java.awt.image.BufferedImage

BufferedImage bi = new BufferedImage(iWidth, iHeight, BufferedImage.TYPE_INT_RGB);
int[] frameBuffer = ((DataBufferInt)bufferedImage.getRaster().getDataBuffer()).getData();

now you can write your RGB values in the int-array, then draw the image with the drawImage() method...

hope this helps,

-sascha

> Hi guys,
>
[quoted text clipped - 18 lines]
>
> Andrew


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.