Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Problem Setting Up  (Read 905 times)
0 Members and 1 Guest are viewing this topic.
Offline hobbles

Junior Devvie


Medals: 2
Exp: 4 years


hmm what


« Posted 2013-09-18 20:32:09 »

Hi, I just started using LWJGL with eclipse recently and had no problem setting it up on my main computer but for some reason it is not working on my laptop. It's the same project and everything the only difference I could think of is my main computer is 64bit and my laptop is 32bit, not that I think it would make a difference. I installed LWJGL into my java folder in program files and added the library for the project including the natives so I am at a complete loss. Then I was like hey I'll just get all the stuff to make android games on my laptop and make java games on my other pc and that crap isn't working right either.... just my luck.

This is the compilation error.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
Sep 18, 2013 4:22:27 PM com.base.engine.Main initDisplay
SEVERE: null
org.lwjgl.LWJGLException: Pixel format not accelerated
   at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
   at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
   at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:252)
   at org.lwjgl.opengl.Display.createWindow(Display.java:306)
   at org.lwjgl.opengl.Display.create(Display.java:848)
   at org.lwjgl.opengl.Display.create(Display.java:757)
   at org.lwjgl.opengl.Display.create(Display.java:739)
   at com.webs.burningtreegames.engine.Main.initDisplay(Main.java:83)
   at com.webs.burningtreegames.engine.Main.main(Main.java:22)

Exception in thread "main" java.lang.RuntimeException: No OpenGL context found in the current thread.
   at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
   at org.lwjgl.opengl.GL11.glMatrixMode(GL11.java:2073)
   at com.webs.burningtreegames.engine.Main.initGL(Main.java:68)
   at com.webs.burningtreegames.engine.Main.main(Main.java:23)


Throw in the main class from the tutorial I'm doing and like I said its the same as on my gaming pc.

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  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
package com.base.engine;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;

import com.base.game.GameMain;

import static org.lwjgl.opengl.GL11.*;

public class Main
{

   private static GameMain gameMain;
   
   public static void main(String[] Args)
   {
      initDisplay();
      initGL();
      initGame();
     
      gameLoop();
      cleanUp();
   }
   
   private static void initGame()
   {
      gameMain = new GameMain();
   }
   
   private static void gameLoop()
   {
      while(!Display.isCloseRequested())
      {
         getInput();
         update();
         render();
      }
   }
   
   private static void getInput()
   {
      gameMain.getInput();
   }

   private static void update()
   {
      gameMain.update();
   }
   
   private static void render()
   {
      glClear(GL_COLOR_BUFFER_BIT);
      glLoadIdentity();
     
      gameMain.render();
     
      Display.update();
      Display.sync(60);
   }
   
   private static void initGL()
   {
      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
      glOrtho(0,Display.getWidth(),0,Display.getHeight(),-1,1);
      glMatrixMode(GL_MODELVIEW);
     
      glDisable(GL_DEPTH_TEST);
     
      glClearColor(0,0,0,0);
   }
   
   public static void initDisplay()
   {
     
      try {
         Display.setDisplayMode(new DisplayMode(800,600));
         Display.create();
         Keyboard.create();
         Display.setVSyncEnabled(true);
      } catch (LWJGLException e)
      {
         Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
      }
   }
   
   private static void cleanUp()
   {
      Display.destroy();
      Keyboard.destroy();
   }
}

I'm upset I didn't capitalize the H in my name...
Offline opiop65

JGO Kernel


Medals: 159
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #1 - Posted 2013-09-18 20:43:02 »

You most likely don't have the latest driver for your video card or you have a super old card that doesn't support OpenGL (not likely). Can you post your computer specs?

Offline hobbles

Junior Devvie


Medals: 2
Exp: 4 years


hmm what


« Reply #2 - Posted 2013-09-18 20:48:17 »

Yes, actually I just tried to play another game that uses lwjgl and got the same error in the console.

My laptop has an ati radeon 4100m and I am having a hard time finding a driver for it. Toshiba only has a 2010 driver for my L505d - S5985.

I'm upset I didn't capitalize the H in my name...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Troncoso

JGO Coder


Medals: 20



« Reply #3 - Posted 2013-09-18 21:02:09 »

If you are just using opengl 1, then you should be able to just re-install the video drivers and it fix it.

NOW, besides that...consider lightening up on the static, maybe? It's of no use in the code you've shown besides the main method.

Offline hobbles

Junior Devvie


Medals: 2
Exp: 4 years


hmm what


« Reply #4 - Posted 2013-09-18 21:11:05 »

Its from a tutorial so I don't really know. I have never even used java the way he does. He mad like 3 packages and several classes. He did kinda make the game engine separate though so I don't know.

http://www.youtube.com/watch?v=1eeWo9AVP_4

I'm upset I didn't capitalize the H in my name...
Offline Troncoso

JGO Coder


Medals: 20



« Reply #5 - Posted 2013-09-18 21:18:55 »

I mean, I get what he's doing, but that's just not how anyone generally does it.

Anyway, back to your original problem, just re-install your drivers.
Offline hobbles

Junior Devvie


Medals: 2
Exp: 4 years


hmm what


« Reply #6 - Posted 2013-09-18 21:25:42 »

Alright well thanks guys for replying I finally found out what is going on with the drivers. There is something wrong with the latest catalyst drivers for some of these older cards. I got a 2012 version of catalyst control center and it cleared things up. Also for now I'm just gonna leave everything how he shows it. I don't really care much I just want to learn ideas on how to do rpgs along with using lwjgl other than me just bashing away at it on my own.

I'm upset I didn't capitalize the H in my name...
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (57 views)
2014-11-26 15:22:04

toopeicgaming1999 (50 views)
2014-11-26 15:20:36

toopeicgaming1999 (10 views)
2014-11-26 15:20:08

SHC (24 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (27 views)
2014-11-25 11:26:43

Gibbo3771 (24 views)
2014-11-24 19:59:16

trollwarrior1 (37 views)
2014-11-22 12:13:56

xFryIx (75 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50
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!