ah ok thanks,
I switched to the normal gl renderer in the end
Ill keep that in mind if i have to switch back for some reason.
I switched to the normal gl renderer in the end
Ill keep that in mind if i have to switch back for some reason.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
import com.threed.jpct.*;
//import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.KeyListener;
//import java.awt.Insets;
import javax.swing.JFrame;
public class mousebutton extends JFrame implements MouseListener,
MouseMotionListener,KeyListener {
public static World world;
private FrameBuffer buffer;
public JFrame frame;
public void keyPressed(KeyEvent e)
{}
public void keyTyped(KeyEvent e)
{
if (e.getKeyCode()==KeyEvent.VK_A)
{
//System.out.println("typed a");
}
//nothing
}
public void keyReleased(KeyEvent e)
{
if (e.getKeyCode()==KeyEvent.VK_W)
{
//System.out.println("released a");
}
//nothing
}
public static void main(String[] args) throws Exception {
new mousebutton().loop();
}
public void mouseEntered( MouseEvent e ) {}
public void mouseExited( MouseEvent e ) {}
public void mouseReleased( MouseEvent e ){
System.out.println("mouse released");
}
public void mouseClicked( MouseEvent e ){
System.out.println("mouse clicked");
}
public void mousePressed( MouseEvent e )
{
}
public void mouseMoved( MouseEvent e ) {
int x = e.getX();
int y = e.getY();
}
public void mouseDragged( MouseEvent e )
{
// get the mouse's coordinates:
}
public mousebutton() throws Exception {
frame=new JFrame("Hello world");
frame.setSize(800, 600);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
}
private void loop() throws Exception {
FrameBuffer buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
Canvas canvas=buffer.enableGLCanvasRenderer();
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
frame.add(canvas);
canvas.addMouseListener( this );
canvas.addMouseMotionListener( this );
canvas.addKeyListener(this);
while (frame.isShowing()) {
buffer.clear(java.awt.Color.BLACK);
world.renderScene(buffer);
world.draw(buffer);
buffer.update();
buffer.displayGLOnly();
canvas.repaint();
//Bullet.update_bullets();
Thread.sleep(10);
//System.out.println(Mouse.getDX());
}
//buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
// buffer.dispose();
frame.dispose();
System.exit(0);
}
}
Page created in 0.035 seconds with 12 queries.