Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (496)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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: Errors with NeHe JOGL ports. on: 2011-05-09 17:50:21
Thanks for the responses guys, and thanks a lot for the link Smiley

I'm having trouble finding up-to-date tutorials, especially ones that have been ported to java. I bought myself the 3.0/3.1 edition of the OpenGL RedBook to get myself started, and getting the examples running with JOGL involves an annoying amount of trial and error for me Sad maybe I ought to rewrite a few of the NeHe tutorials myself for the current JOGL version once I get my head around it Cheesy
2  Game Development / Newbie & Debugging Questions / Errors with NeHe JOGL ports. on: 2011-05-09 15:44:27
Hi everyone, I'm new here. Spent the last few days trawling these forums looking for a thread to participate in without making myself look a fool, with no luck! At last I have a reason post Smiley

I'm working my way through the JOGL ports of the NeHe OpenGL tutorials, and I've come across some function calls that, as far as I can tell, don't exist for me. An example would be the following code, found in lesson 2.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public void reshape(GLDrawable gLDrawable, int x, int y, int width, int height)
    {
      final GL gl = gLDrawable.getGL();
      final GLU glu = gLDrawable.getGLU();

      if (height <= 0) // avoid a divide by zero error!
       height = 1;
      final float h = (float)width / (float)height;
      gl.glViewport(0, 0, width, height);
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glLoadIdentity();
      glu.gluPerspective(45.0f, h, 1.0, 20.0);
      gl.glMatrixMode(GL.GL_MODELVIEW);
      gl.glLoadIdentity();
    }


The first two function calls, to getGL() and getGLU(), I see very often in the tutorials I stumble across. However, to get this code working I've had to change it to:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
    {
       final GL2 gl = drawable.getGL().getGL2();
        final GLU glu = new GLU();

        ...

        gl.glMatrixMode(GL2.GL_PROJECTION);
        ...
        gl.glMatrixMode(GL2.GL_MODELVIEW);
        ...
    }


Have certain functions been removed from the later versions of JOGL? If so, is there somewhere I can look to find all the changes? I'm relatively new to both Java and JOGL, and so I'm unsure if the workaround I'm being forced to use is the correct way to do so.

EDIT: Typo.
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.

BurntPizza (14 views)
2014-09-19 03:14:18

Dwinin (32 views)
2014-09-12 09:08:26

Norakomi (58 views)
2014-09-10 13:57:51

TehJavaDev (80 views)
2014-09-10 06:39:09

Tekkerue (40 views)
2014-09-09 02:24:56

mitcheeb (62 views)
2014-09-08 06:06:29

BurntPizza (46 views)
2014-09-07 01:13:42

Longarmx (33 views)
2014-09-07 01:12:14

Longarmx (37 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!