Results 1 to 9 of 9

Thread: What is JAVA BufferStrategy and how it works

  1. #1
    Join Date
    May 2012
    Posts
    134

    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.

  2. #2
    Join Date
    Mar 2011
    Posts
    160

    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.

  3. #3
    Join Date
    May 2011
    Posts
    105

    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.

  4. #4
    Join Date
    May 2011
    Posts
    102

    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.

  5. #5
    Join Date
    May 2009
    Posts
    527

    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.

  6. #6
    Join Date
    Mar 2010
    Posts
    154

    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.

  7. #7
    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.

  8. #8
    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)

  9. #9
    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

Similar Threads

  1. Why 'if blocks' not works in Java
    By Raju Chacha in forum Software Development
    Replies: 3
    Last Post: 20-01-2012, 01:01 PM
  2. Replies: 5
    Last Post: 26-08-2011, 10:31 PM
  3. Replies: 3
    Last Post: 25-03-2011, 10:15 AM
  4. How SDA and DDA works in Java Card
    By Rivan in forum Software Development
    Replies: 5
    Last Post: 20-07-2010, 05:13 AM
  5. Replies: 2
    Last Post: 21-02-2009, 12:01 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,531,692.63220 seconds with 17 queries