Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What is JAVA BufferStrategy and how it works

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 26-04-2013
Member
 
Join Date: May 2012
Posts: 126
What is JAVA BufferStrategy and how it works
  

I had started learning JAVA. I am taking some online video tutorial for the same. I had reached to an intermediate level where I can write basic programs in JAVA. Now the issue lies with some terms which are just going over my head. One thing that I am still not able to get properly is BufferStrategy in Java. It reflects some animation effects of the application or program. But what does it really do. Means for what it is really applied. I tried to watch some videos on that, but there is no particular video available on the same. Can anyone guide me here.

Reply With Quote
  #2  
Old 26-04-2013
Member
 
Join Date: Mar 2011
Posts: 156
Re: What is JAVA BufferStrategy and how it works

I will recommend you to go for some beginners guide. You cannot just jump upon any term and learn JAVA easily. It is necessary that you follow a track to understand how it actually works. There are ample free ebooks on the web that can teach you a lot about that.
Reply With Quote
  #3  
Old 27-04-2013
Member
 
Join Date: May 2011
Posts: 103
Re: What is JAVA BufferStrategy and how it works

Bufferstrategy here take care about the video memory usage. It allows the hardware to take complete advantage of double buffering or page flipping. Some kind of animated effect on the web. The class which is used here is java.awt.image.BufferStrategy. It also helps to deal with VolatileImage problems. Ample of application runs on full screen mode that is manage well through this. It is one of the necessary part used on windows system and at that point it is essential to determine the video memory used. It is just an kind of mechanism which help you to organize the memory usage for an window. Depending on the hardware and software limitation it is implemented. There are some good articles available on web that tells you well about using the same. You can then simply move ahead with adding this in your program. It is correct that directly jumping on the advance option will give you trouble. So better understand the basic concept first. That is most required. And then you can simply move ahead with some advance stuff with sample script to run it and verify how it actually works and what are the output on the same.
Reply With Quote
  #4  
Old 27-04-2013
Member
 
Join Date: May 2011
Posts: 99
Re: What is JAVA BufferStrategy and how it works

The term is mostly associated with the game development stuff. It comes in the later part when you move ahead with java development but somehow it is recommended that you go with the basic concepts first. Under them properly so that will be more beneficial.
Reply With Quote
  #5  
Old 29-04-2013
Member
 
Join Date: May 2009
Posts: 523
Re: What is JAVA BufferStrategy and how it works

If you know about hardware acceleration then you can simply easily understand what bufferstartegy is. In the older edition of JAVA there was problem with double buffering. And the new editions right now are far more better which can also take advantage from DirectX or OpenGl. To work with hardware acceleration you have to use java.awt.Canvas component. This class simply work really well and also avoid the use of bufferstrategy. There are many things taken into consideration. Not just some simple terms of class. So it is essential that you must first learn about hardware acceleration in dept which will be more okay for you to make your concept clear. There are older and newer edition of JAVA and they are having some improvement which is also need to be looked. You cannot just ignored older components here.
Reply With Quote
  #6  
Old 29-04-2013
Member
 
Join Date: Mar 2010
Posts: 153
Re: What is JAVA BufferStrategy and how it works

I am going to list you some free ebooks here which are best for JAVA. You can learn many things from it. The ebooks are designed to give you a simple way of learning java programming and designing applications as per your need. They are free. You can download them in pdf format and install it in your pc. They are The Java Language Specification, The Java Tutorial and Introduction to Programming Using Java. Just download anyone of them and go through the process. I am sure that will be enough to understand ample of JAVA concepts.
Reply With Quote
  #7  
Old 29-03-2014
Member
 
Join Date: Mar 2014
Posts: 3
Re: What is JAVA BufferStrategy and how it works

Quote:
Originally Posted by LFC18 View Post
I had started learning JAVA. I am taking some online video tutorial for the same. I had reached to an intermediate level where I can write basic programs in JAVA. Now the issue lies with some terms which are just going over my head. One thing that I am still not able to get properly is BufferStrategy in Java. It reflects some animation effects of the application or program. But what does it really do. Means for what it is really applied. I tried to watch some videos on that, but there is no particular video available on the same. Can anyone guide me here.
Hey Hi ,
Hope you are doing good

In my opinion Java is the best Platform Independent language.
If you want to go deep in Java , Just read Oracle Docs for Java.
I am giving you the link for Oracle Docs
docs.oracle.com

Hope you get your answer here.
Reply With Quote
  #8  
Old 28-04-2014
Member
 
Join Date: Apr 2014
Posts: 3
Re: What is JAVA BufferStrategy and how it works

In Java 2 Standard Edition, you don't have to worry about video pointers or video memory in order to take full advantage of either double-buffering or page-flipping. The new class java.awt.image.BufferStrategy has been added for the convenience of dealing with drawing to surfaces and components in a general way, regardless of the number of buffers used or the technique used to display them.

A buffer strategy gives you two all-purpose methods for drawing: getDrawGraphics and show. When you want to start drawing, get a draw graphics and use it. When you are finished drawing and want to present your information to the screen, call show. These two methods are designed to fit rather gracefully into a rendering loop:

BufferStrategy myStrategy;

while (!done) {
Graphics g = myStrategy.getDrawGraphics();
render(g);
g.dispose();
myStrategy.show();
}

Buffer strategies have also been set up to help you monitor VolatileImage issues. When in full-screen exclusive mode, VolatileImage issues are especially important because the windowing system can sometimes take back the video memory it has given you. One important example is when the user presses the ALT+TAB key combination in Windows--suddenly your full-screen program is running in the background and your video memory is lost. You can call the contentsLost method to find out if this has happened. Similarly, when the windowing system returns your memory to you, you can find out using the contentsRestored method.

Source: BufferStrategy and BufferCapabilities from docs.oracle.com (The Java Tutorials)
Reply With Quote
  #9  
Old 29-04-2014
Member
 
Join Date: Apr 2014
Posts: 3
Re: What is JAVA BufferStrategy and how it works

Great insight on Java buffer strategy, all the posts have good information to understand the concept well
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What is JAVA BufferStrategy and how it works"
Thread Thread Starter Forum Replies Last Post
Why 'if blocks' not works in Java Raju Chacha Software Development 3 20-01-2012 01:01 PM
Google translate hover function works in Internet Explorer but doesn?t works any longer in Chrome Pranvi Technology & Internet 5 26-08-2011 10:31 PM
Java Environment works in administrator but not in standard user - Firefox 4.0 Kindle Technology & Internet 3 25-03-2011 10:15 AM
How SDA and DDA works in Java Card Rivan Software Development 5 20-07-2010 05:13 AM
ITunes doesn't works user account but works with admin account Rupert Windows Software 2 21-02-2009 12:01 AM


All times are GMT +5.5. The time now is 04:16 AM.