Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (517)
Games in Android Showcase (123)
games submitted by our members
Games in WIP (578)
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  Game Development / Newbie & Debugging Questions / Re: Issue involving drawing on: 2012-08-10 15:05:49
Thank you again Cheesy

This is for you

https://www.youtube.com/watch?v=Dq0llrCYtCQ
2  Game Development / Newbie & Debugging Questions / Re: Issue involving drawing on: 2012-08-10 01:22:13
I now receive an error on compile every 10th or so try, the error and code in question is as follows:

Error:

Exception in thread "Thread-3" java.lang.IllegalStateException: Buffers have not been created
   at sun.awt.windows.WComponentPeer.getBackBuffer(Unknown Source)
   at java.awt.Component$FlipBufferStrategy.getBackBuffer(Unknown Source)
   at java.awt.Component$FlipBufferStrategy.updateInternalBuffers(Unknown Source)
   at java.awt.Component$FlipBufferStrategy.revalidate(Unknown Source)
   at java.awt.Component$FlipBufferStrategy.revalidate(Unknown Source)
   at java.awt.Component$FlipBufferStrategy.getDrawGraphics(Unknown Source)

Code part 1:

   public main()
   {

      ......
     
      setIgnoreRepaint(true);
      this.setVisible(true);
 

      createBufferStrategy(2);  <--- These two lines are pointed to some times
      bufferStrategy = getBufferStrategy(); <---
 

      runGameLoop();
   }


Code part 2:
   private void drawGame(float interpolation)
   {
      gamePanel.setInterpolation(interpolation);
      gamePanel.draw(); <--- Where the offscreen image is set up and drawn to onscreen
      Graphics g = bufferStrategy.getDrawGraphics(); //<-- being pointed to in this error
      g.drawImage(onScreenImage, 0, 0, null);
      g.dispose();
      bufferStrategy.show();
   }


3  Game Development / Newbie & Debugging Questions / Re: Issue involving drawing on: 2012-08-02 19:50:31
After a few days of messing with it I finally got my double buffering working and you were indeed right, it was jframes double buffering. Thank you again for you help  Grin
4  Game Development / Newbie & Debugging Questions / Re: Issue involving drawing on: 2012-07-24 07:26:13
Very helpful thank you! I am using a JFrame with an attached JPanel which is being drawn on. I had heard they had their own double buffering so I overlooked that a bit. I will give your suggestion a shot and see if it corrects it when I get home from work. Thanks again Cheesy
5  Game Development / Newbie & Debugging Questions / Issue involving drawing on: 2012-07-24 07:02:29
Hello!

I have been writing my first large scale game from scratch in Java/JSwing. The game I am making is a 2d overhead tile based game. Each land tile is a uniform size of 20x20 pixels and is redrawn every update as of now. Everything works fine except on a rare occasion where several blocks (always touching each other) seem to fail to draw for one draw cycle. The grey outline of the part-row/column appears and then quickly disappears as it is redrawn on the next draw call.

I cannot easily reproduce this however I notice that it only appears when I spam keyboard and mouse input. Usually once per 10/20 seconds of hammering my left/right click and keyboard will seemingly cause it to come up but really I cannot be sure if this is the cause or just something that exadurates an underling problem. I am using a class which extends keyAdapter and my main class implements ActionListener/MouseListener.

Has anyone heard of something causing this or have any ideas at all? I can post whatever code may be helpful if requested, please just specify which parts you wish to see. Thanks for your time!
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

DarkCart (14 views)
2014-10-31 21:44:48

DarkCart (17 views)
2014-10-31 21:43:57

TehJavaDev (40 views)
2014-10-27 03:28:38

TehJavaDev (30 views)
2014-10-27 03:27:51

DarkCart (44 views)
2014-10-26 19:37:11

Luminem (26 views)
2014-10-26 10:17:50

Luminem (30 views)
2014-10-26 10:14:04

theagentd (36 views)
2014-10-25 15:46:29

Longarmx (64 views)
2014-10-17 03:59:02

Norakomi (62 views)
2014-10-16 15:22:06
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!