Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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  Java Game APIs & Engines / JOGL Development / Setting up jogl in linux with eclipse on: 2007-09-20 17:34:51
I understand how to add the jar files to the classpath in eclipse but I am not sure what to do with the .so files.  I've spent awhile now try to figure this out and most of the link I have found say not to add things to the $LD_LIBRARY_PATH.  Anyhow, I am not very proficient at using linux yet, so I do not even know how to add to this path.  If someone could help me I would really appreciate it.
2  Game Development / Newbie & Debugging Questions / java window slowdown on: 2007-09-02 19:03:26
I am trying to figure out why this code cause the window responsiveness to become really laggy.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JPanel;


public class GamePanel extends JPanel implements Runnable{
   
   private Game game = Game.getInstance();
   private Image buffer = null;
   private int width,height;
   
   public GamePanel(JFrame f){
      width = 650;
      height = 480;
      this.setBackground(Color.black);
      this.setPreferredSize(new Dimension(width,height));
      this.setDoubleBuffered(false);
      this.setFocusable(true);
      this.requestFocus();
      f.getContentPane().add(this);
      f.pack();
      f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   }
   
   /**
    * Main loop into game
    */

   public void run(){
     
      //create buffer
      buffer = createImage(width,height);
     
      while(!game.over()){
         game.update();
         game.render(buffer);
         paintScreen();
         //need frame rate control here
      }
     
     
   }
   
   
   private void paintScreen() {
      Graphics g = null;
      g = this.getGraphics();
      g.drawImage(buffer, 0, 0, null);
      Toolkit.getDefaultToolkit().sync();
     
   }
   
   
   public void paintComponents(Graphics g){
      super.paintComponents(g);
      if(buffer != null) g.drawImage(buffer,0,0,null);
   }
   
   
   public static void main(String[] args){
      JFrame jframe = new JFrame();
      GamePanel panel = new GamePanel(jframe);
      Thread game = new Thread(panel);
      game.start();
      jframe.setVisible(true);
   }
}
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.

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

Norakomi (37 views)
2014-10-16 15:22:06

Norakomi (28 views)
2014-10-16 15:20:20

lcass (32 views)
2014-10-15 16:18:58

TehJavaDev (62 views)
2014-10-14 00:39:48

TehJavaDev (62 views)
2014-10-14 00:35:47

TehJavaDev (52 views)
2014-10-14 00:32:37

BurntPizza (70 views)
2014-10-11 23:24:42

BurntPizza (40 views)
2014-10-11 23:10:45

BurntPizza (82 views)
2014-10-11 22:30:10
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!