Getting graphic display with GL4java

Hello .. I'm trying to get a basic display with GL4java. I'm able
to create the main window but cannot get any openGL display. I've first defined a class which extends from JFrame who is the main window. From the panel, I've added a class which extends from Canvas. This is the class where I define the openGL configurations.. !
I don't know why I can't get an openGL display. Would you know what I'm doing wrong.
-=-=-=-=-=-=-
code from Graphique.java
/* Generated by Together */
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.net.*;
import java.lang.*;
import java.util.*;
import java.io.*;
import gl4java.*;
import gl4java.awt.*;
import gl4java.drawable.*;
import gl4java.utils.textures.*;
import gl4java.utils.glut.*;
public class Graphique extends Canvas implements GLEventListener, MouseListener, MouseMotionListener, KeyListener{
constructeur
public Graphique()
setSize(400,400);
addKeyListener(this);
x = 0;
y = 0;
public void init(GLDrawable drawable)
System.out.println("ICI");
gl = drawable.getGL();
glu = drawable.getGLU();
glut = new GLUTFuncLightImpl(gl, glu);
glj = drawable.getGLContext();
this.gldrawable = drawable;
public void display(GLDrawable drawable)
//gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glu.gluLookAt(0.0,0.0,10.0,0.0,0.0,0.0,0.0,-1.0,0.0);
gl.glMatrixMode(GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(45.0f,1.0,0.1f,150.0f);
gl.glMatrixMode(GL_MODELVIEW);
gl.glBegin(gl.GL_QUADS);
gl.glColor3d(1.0,0.0,0.0);
gl.glVertex3d(0.0,0.0,1.0);
gl.glVertex3d(1.0,0.0,1.0);
gl.glVertex3d(1.0,1.0,1.0);
gl.glVertex3d(0.0,1.0,1.0);
gl.glColor3d(0.0,1.0,0.0);
gl.glVertex3d(3.0,3.0,1.0);
gl.glVertex3d(4.0,3.0,1.0);
gl.glVertex3d(4.0,4.0,1.0);
gl.glVertex3d(3.0,4.0,1.0);
gl.glColor3d(0.0,0.0,1.0);
gl.glVertex3d(4.0,4.0,1.0);
gl.glVertex3d(5.0,4.0,1.0);
gl.glVertex3d(5.0,5.0,1.0);
gl.glVertex3d(4.0,5.0,1.0);
gl.glEnd();
public void reshape(gl4java.drawable.GLDrawable gld, int width, int height)
float h = (float) height / (float) width;
gl.glViewport(0,0,width,height);
gl.glMatrixMode(GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(45.0f,1.0,0.1f,150.0f);
gl.glMatrixMode(GL_MODELVIEW);
gl.glLoadIdentity();
public void cleanup(GLDrawable drawable)
System.out.println("destroy(): " + this);
drawable.removeMouseListener(this);
drawable.removeMouseMotionListener(this);
public void postDisplay(GLDrawable drawable) {}
public void preDisplay(GLDrawable drawable) {}
paint(Graphics)
public void paint(Graphics g) {
//g.drawRect(x, y, x+1, y+1); // draw border
//g.drawString("le jeu va ici :)", 20,20);
//setBackground(Color.blue);
GLFunc gl;
gl.glPushMatrix();
gl.glPopMatrix();
keyPressed(KeyEvent)
public void keyPressed(KeyEvent evt)
int no = evt.getKeyCode();
System.out.println(no);
switch(no)
case 40: //DOWN
y += 5;
break;
case 39: //RIGHT
x += 5;
break;
case 37: //LEFT
x -= 5;
break;
case 38: //UP
y -= 5;
break;
case 10: //ENTER
break;
case 27: //ESC
break;
case 17: //CTRL
break;
case 18: //ALT
break;
//repaint();
keyReleased(KeyEvent)
public void keyReleased(KeyEvent evt)
int no = evt.getKeyCode();
//System.out.println(c);
keyTyped(KeyEvent)
public void keyTyped(KeyEvent evt){}
public void mouseExited(MouseEvent evt) {}
public void mousePressed(MouseEvent evt) {}
public void mouseReleased(MouseEvent evt) {}
public void mouseClicked(MouseEvent evt) {}
public void mouseDragged(MouseEvent evt) {}
public void mouseMoved(MouseEvent e) {}
public void mouseEntered(MouseEvent evt) {}
int x;
int y;
private GLFunc gl;
private GLUFunc glu;
private GLUTFunc glut;
private GLContext glj;
private GLDrawable gldrawable;
//private Joueur joueur1;
//private Joueur joueur2;
//private Joueur joueur3;
//private Joueur joueur4;
//private Plateau UnPlateau;
}

That's what I did. However, I browse the code given with the NeHe jars and was able to retrieve the information I needed to start my application.
Still, there's something that's bugging me. I can run my application with JBuilder, but not using java, javac MSdos tools. I receive an error saying that my class is not recognized when I add to classpath to gl4java jars.
the reason why I want to use java basic tools is that my computer just crashed a few time when I executed the program. I believe it's because of JBuilder which is oversurpassing my computer's ressources. You see, I use a pII 266 with 64meg ram, while the recommended speed is 128meg ram.
thanks again for your time :)

Similar Messages

  • Still Graphic displayed with idle DVD

    Not sure exactly how to describe the feature, but if i stick a commercial DVD into my powerbook, i get a prompt from DVD Player that asks if i want to start the disc from the beginning or "last time played." What i'm interested in is what the DVD is displaying during this prompt. Generally, there is a graphic displayed with the title and artwork from the film . It is a still, but i'm not sure if its a special menu or slideshow or what.
    I'm having trouble finding documentation about it as i don't even know what its called. Is anyone familiar with this feature or what the technical name/behavior is? Is it something that has to be scripted?
    Thanks!
    G5   Mac OS X (10.4.9)  
    G5   Mac OS X (10.4.9)  

    Hi:
    Wellcome to the forums !
    Search for About Jacket Pictures in DVDSP User Manual. I think that's what you mean.
    I never used this feature but heard that not all players can deal with it fine. Look at this SEARCH in this forum for other threads related:
    http://discussions.apple.com/search.jspa?objID=f952&search=Go&q=jacket
    Hope that helps!
      Alberto

  • How to get ALV Display with First column alone in sort

    How to get ALV Display with First column alone in sort

    HI,
    You can build Internal Table and send this to the parameter "IT_SORT".
    eg:
    "the sorting Internal Table structure is as whown below.
    DATA:  t_sort_info type slis_t_sortinfo_alv.
    "Build the Sort Internal Table
      t_sort_info-fieldname = 'CARRID'.
      t_sort_info-subtot = 'X'.
      append t_sort_info.
      t_sort_info-fieldname = 'FLDATE'.
      t_sort_info-subtot = 'X'.
      append t_sort_info.
    Then pass this "IT_SORT_INFO" table to the Function module "Reuse_alv_*". (Note send the body of the Internal table only like "<b>IT_SORT = IT_SORT_INFO[]</b>".
    Here i am making ALV output sorted on CARRID & FLDATE.
    You can specify only the First Column name for sorting.
    Regards,
    Manju
    Message was edited by:
            MANJUNATHA KS

  • How do I Get Extended display with another monitor?

    I connected my iMac to another LCD Display, and i'd like to get both monitors to be extended displays instead of mirror displays. Basically Both monitors are showing the same image, but i would like to have both monitors be extended and not share the same screen, for the main reason of working with Logic Music, and i need more visual space to work with.
    My question... How can i do that?
    I went to the help, and the help menu said..
    1.)Open System Preferences and click Displays.
    2.)Click Arrangement and follow the onscreen instructions.
    But i don't see Arrangement on my displays window.

    Hi,
    GOT IT !
    Hope this helps someone in future....
    The Popup Key LOV (Displays description, returns key value), and probably other Popups, automatically create a hidden field for the return value.
    My field was P7_CONTACT so htmldb creates a hidden item P7_CONTACT_HIDDENVALUE
    P7_CONTACT.value equals the display text.
    P7_CONTACT_HIDDENVALUE.value equals the ID value.
    So, I can access the returned Display name by:
    html_GetElement('P7_CONTACT').value
    Done deal...
    Thanks, Bill :>)

  • [SOLVED] Graphic Corruption with 3D and Wine 1.3.8 + Catalyst 10.11

    Hello!
    I'm getting graphic corruption with 3D games on my Arch Linux configuration using Wine and Catalyst. Tried World of Warcraft (also with opengl rendering) and Guild Wars - graphics look stretched and teared.
    Using ATI Mobility Radeon HD4570.
    Any ideas? Thanks in advance.
    Last edited by CHPE (2011-01-02 17:37:11)

    I get same problem with guildwars in fullscreen when entering character select. I have to ctrl-alt-F1 to tty then back to get rid of the garbled graphics. Then my characters vanishes except for their armor/effects. Going into windowed mode stops the garbling of the graphics but the bodyless avatars remain. There is one error stands out in wine output but can't find anything specific to this error that helps.
    fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
    Infos
    2.6.36-ARCH X86_64
    ATI Radeon 5870
    catalyst-hook 10.11-1
    catalyst-utils 10.11-1
    lib32-catalyst-utils
    xorg 1.9.2
    wine 1.3.9 (same problem with previous versions of wine)
    Winetricks version 20101106
    Last edited by Snakeye (2010-12-13 03:03:49)

  • I keep getting a display message saying this cable or accessory is not capitiable with this apple product may not be reliable with this iphone even when i have no cable or accessory in use

    My iphone 5 has been saying this for days now. Yes I have recently purchased a motorola ear piece for easy talking while walking, but i have also used a 10ft cord purchased at walmart for months now and no display before the motorola. now even without anything plugged in ,I still get the display message on my phone saying" the cord or accessory is not capitable with this iphone and may not be reliable with this iphone.
    what DO I do ?! is there something I can do without going to either Sprint or Apple for help.... will this be damaging to my iphone ?! HELP before its too late.
    sincerely,
    Apple lover JAJA

    Try resetting your iPhone.  Hold the on/off and home buttons together for about 10 seconds till the Apple logo appears.
    CAUTION - This may get rid of the warning for now, but the issue the warning points out still remains.  One or both of your cables is certainly suspect.

  • I purchased a song on iTunes and it is displayed in my list of SONGS.  However, when I try to add to my iPhone 4, it displays with a small circle of dots to the left of the song title and will not play.  How do I get this song onto my device?

    I purchased a song on iTunes and it is displayed in my list of SONGS.  However, when I try to add to my iPhone 4, it displays with a small circle of dots to the left of the song title and will not play.  How do I get this song onto my device?

    Hi TKCDM1!
    You should try to get this purchase onto your iOS device by using the suggestions in the following article:
    Downloading past purchases from the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/ht2519
    Thanks for being a part of the Apple Support Communities!
    Regards,
    Braden

  • How can I get an album with multiple artists to display in my Nano as one album insteadof multiple albums?

    How can I get an album with multiple artists to display in my Nano as one album insteadof multiple albums?

    See this page for helpful information.
    http://samsoft.org.uk/iTunes/grouping.asp
    B-rock

  • After having to reinstall my drive with applications I get a message with Premiere Pro CS5 that it can't find any "capable video play modules" and asks me to "update" my "video display modules". How do I do this? I am using a mid-2010 iMac 27" with 10.7.3

    After having to re-install my start-up drive recently I am getting a message with Adobe Premiere Pro CS5 that it can't find any "capable video play modules" and asks me to "update" my "video display modules". I am using a mid-2010 iMac 27" with OSX 10.7.3. How do I do this?

    Premiere is an Adobe application and is supported in their forums.
    Good luck.
    x

  • Ibooks author, how do I get the standard book pages background into my document. I have published one book so far which does not display with a book pages background or options for font size.

    ibooks author, how do I get the standard book pages background into my document. I have published one book so far which does not display with a book pages background or options for font size.

    No on the book title, no problem there.
    The issue is: my book pages appear as on white paper, no background that resembles a open book and also no option to change fonts. The book was created in iBooks author, there was a problem going with the "Publish" menu route so I was instructed my Apple to "export" the file and submit that. I think that's the problem after reading that iBooks author is a hybrid epub file.
    Thanks for getting back to me.

  • I have a 27" Flat Panel Cinema Display with a failed LED panel. How much would this cost to get fixed?

    Just wondering if it's worth it to get fixed, or if I should just save my money for a new one. It is currently out of warranty. Any information would be great!

    Save your money.  The repair costs will be the same as buying a brand new Cinema Display.  Dell sells the same IPS display with different connectors, but they include a 3 year warranty.

  • Unable to get the graphical display of Business process in BPMon

    Hi,
    I am working on solution manager 7.1. I have set up a business process for monitoring in the BPMon session. But i am not getting the graphical display in the business process operations workcenter in the graphical view tab.
    Can anyone tell me how can i get that.
    Regards
    Vishal

    Hi,
    Please run run report RTCCTOOL and see if any addon is not up-to-date.
    Please run this repport and follow the recommendations to update those
    components to the latest status.
    Afterwards please also intall the latest version of following note: 1570282 - Advance Corr. BPMon ST-A/PI 01N
    Finally please deactivate BPMon, regenerate and re-activate agin.
    Also check BPM troubleshooting guide:
    https://websmp102.sap-ag.de/~sapdownload/011000358700001186112010E/
    Troubleshooting_for_BPMon.pdf
    Thanks
    Vikram

  • How do you get the album pictures displayed with the right songs on my iphone 5

    how do you get the album pictures displayed with the right songs on my i phone 5?

    I have the same problem but i only have iphone 4s its only jsut started in the last 2 weeks or so

  • Problem with playroll/graphic display

    Hi, this is my first post so bear with me. I'll try to be as explicit as possible.
    So, I'm having an issue on my iMac 24" 2.4 4GB memory. Randomly, after I edit a VST, or add an effect onto a track and playback the audio, the playroll will quit moving and the graphic displays (volume meters, etc) all stop functioning. If I click on the screen, it flashes the playhead and meters for an instant, and then immediately stops. It's kind of strange; the audio all sounds fine. I just like to see the playhead and movement on the display.
    The real strange thing here is, when I restart Logic 8, even with the same effects and everything enabled--exactly the same--the playhead works fine. Then after a few more edits, this same thing happens. Restarting logic immediately fixes the issue.
    Any advice--whether it be altering my buffer settings, etc--would be greatly appreciated. Thanks for your time!

    Sorry, one thing to add. The things I'm editing are not that crazy--pretty simple stuff, a few filters.

  • I am just starting out in graphic design and I wanted to know how to get more involved with either adobe and or graphic design? I am really very interested in working with adobe and graphic design more and becoming more involved with both!!

    I am just starting out in graphic design and I wanted to know how to get more involved with either adobe and or graphic design? I am really very interested in working with adobe and graphic design more and becoming more involved with both!!

    I have now recently downloaded 10.0.2 which is confusing in itself, as, as far as I can ascertain that is actually version 11, but I'm not even sure about that.
    Version 10.0.2 is the newest version and the successor to GarageBand '11 (version 6.0.5).
    The '11 is referring to the iLife '11 suit of multimedia application - the older GarageBand was a part of this bundle.
    Have a look at Edgar's graphical enhanced manuals, the explain very detailed how things work and why. You can buy them as iBooks from the iBook store or directly from the page:
    http://DingDingMusic.com/Manuals/

Maybe you are looking for

  • Itunes song downloads are frozen in waiting, even though the songs are playable in my music on my phone.

    Recently I have gotten a replacement Iphone 5c, because the first one had a swollen battery. I was having alot of issues syncing my music and in the end, i restored my computer to fix the issue. While my computer was restoring, i manually synced all

  • About Java Mail Api ...Please help..?

    Hi, I am sending email thruogh java mail api. Email has sent but in console, It is in debug mode as this is the messages: DEBUG: JavaMail version 1.4.1* DEBUG: not loading file: C:\Program Files\Java\jdk1.6.0_10\jre\lib\javamail.providers* DEBUG: jav

  • White screen & not able to sync

    I have an ipod touch 1st gen. Just recently, I haven't been able to sync with itunes & my comp. doesn't recognise the ipod (no chime when I connect the ipod thru USB, itunes doesn't show the device as being connected). Also (and I'm not sure if it is

  • Atheros AR5007EG Wireless Network Adapter - With any driver: "The device instance name is invalid"

    Hello there, I was trying to install various "Atheros AR5007EG Wireless Network Adapter" drivers, with versions ranging from 2007 to 2010, both from the manufacturer and specifically for this computer (a Fujitsu Siemens Esprimo Mobile) and others fro

  • Special characters in shell script

    I'd like to run the following one line shell script which brings up the login window. /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend this works form the terminal but I want to do it inside apple script using