Linux/win32 changes for 0.6

This commit is contained in:
Elias Naur 2003-03-30 19:26:39 +00:00
parent d4dbc47949
commit bc33d3ff2b
17 changed files with 627 additions and 457 deletions

View file

@ -114,14 +114,14 @@ public abstract class Window {
*/
public final void setTitle(String newTitle) {
title = newTitle;
nSetTitle();
nSetTitle(title);
}
/**
* Native implementation of setTitle(). This will read the window's title member
* and stash it in the native title of the window.
*/
private native void nSetTitle();
private native void nSetTitle(String title);
/**
* @return true if the user or operating system has asked the window to close
@ -156,13 +156,10 @@ public abstract class Window {
*/
public final void paint() {
dirty = false;
swapBuffers();
doPaint();
}
/**
* Swap the buffers.
*/
private native void swapBuffers();
protected abstract void doPaint();
/**
* Create the window.
@ -188,7 +185,6 @@ public abstract class Window {
if (!created)
return;
doDestroy();
nDestroy();
currentWindow = null;
created = false;
}
@ -198,10 +194,6 @@ public abstract class Window {
*/
protected abstract void doDestroy();
/**
* Natively destroy the window
*/
private native void nDestroy();
/**
* @return the native window handle

View file

@ -133,6 +133,15 @@ public class BaseGL extends Window {
protected void doCreate() throws Exception {
nCreate(getTitle(), x, y, getWidth(), getHeight(), color, alpha, depth, stencil, fullscreen);
}
protected void doPaint() {
swapBuffers();
}
/**
* Swap the buffers.
*/
private native void swapBuffers();
/**
* Native method to create a windowed GL