lwjgl2-arm64/src/java/org/lwjgl/opengl/DisplayImplementation.java

241 lines
6.1 KiB
Java
Raw Normal View History

2004-11-25 23:31:38 +01:00
/*
* Copyright (c) 2002-2004 LWJGL Project
* All rights reserved.
2004-11-25 23:31:38 +01:00
*
* Redistribution and use in source and binary forms, with or without
2004-11-25 23:31:38 +01:00
* modification, are permitted provided that the following conditions are
* met:
2004-11-25 23:31:38 +01:00
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
2004-11-25 23:31:38 +01:00
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
2004-11-25 23:31:38 +01:00
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2004-11-25 23:31:38 +01:00
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
2004-11-25 23:31:38 +01:00
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.lwjgl.opengl;
/**
* This is the Display implementation interface. Display delegates
* to implementors of this interface. There is one DisplayImplementation
* for each supported platform.
* @author elias_naur
*/
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.ByteBuffer;
import org.lwjgl.LWJGLException;
public interface DisplayImplementation {
2004-11-25 23:31:38 +01:00
void createWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException;
void destroyWindow();
void switchDisplayMode(DisplayMode mode) throws LWJGLException;
/**
* Reset the display mode to whatever it was when LWJGL was initialized.
* Fails silently.
*/
2004-11-25 23:31:38 +01:00
void resetDisplayMode();
/**
* Return the length of the gamma ramp arrays. Returns 0 if gamma settings are
* unsupported.
*
* @return the length of each gamma ramp array, or 0 if gamma settings are unsupported.
*/
2004-11-25 23:31:38 +01:00
int getGammaRampLength();
/**
* Native method to set the gamma ramp.
*/
2004-11-25 23:31:38 +01:00
void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException;
/**
* Get the driver adapter string. This is a unique string describing the actual card's hardware, eg. "Geforce2", "PS2",
* "Radeon9700". If the adapter cannot be determined, this function returns null.
* @return a String
*/
2004-11-25 23:31:38 +01:00
String getAdapter();
/**
* Get the driver version. This is a vendor/adapter specific version string. If the version cannot be determined,
* this function returns null.
* @return a String
*/
2004-11-25 23:31:38 +01:00
String getVersion();
/**
* Initialize and return the current display mode.
*/
2004-11-25 23:31:38 +01:00
DisplayMode init();
/**
* Native implementation of setTitle(). This will read the window's title member
* and stash it in the native title of the window.
*/
2004-11-25 23:31:38 +01:00
void setTitle(String title);
2004-11-25 23:31:38 +01:00
boolean isCloseRequested();
2004-11-25 23:31:38 +01:00
boolean isVisible();
boolean isActive();
2004-11-25 23:31:38 +01:00
boolean isDirty();
/**
* Swap double buffers.
*/
2004-11-25 23:31:38 +01:00
void swapBuffers();
/**
* Make the window the current rendering context for GL calls.
*/
2004-11-25 23:31:38 +01:00
void makeCurrent() throws LWJGLException;
/**
* Create the native OpenGL context.
* @throws LWJGLException
*/
2004-11-25 23:31:38 +01:00
void createContext(PixelFormat pixel_format) throws LWJGLException;
2004-11-25 23:31:38 +01:00
void destroyContext();
/**
* Updates the windows internal state. This must be called at least once per video frame
* to handle window close requests, moves, paints, etc.
*/
2004-11-25 23:31:38 +01:00
void update();
2004-11-25 23:31:38 +01:00
void setVSyncEnabled(boolean sync);
2004-11-25 23:31:38 +01:00
void reshape(int x, int y, int width, int height);
/**
* Native method for getting displaymodes
*/
2004-11-25 23:31:38 +01:00
DisplayMode[] getAvailableDisplayModes();
/*
* Mouse methods
*/
/** Native query of wheel support */
2004-11-25 23:31:38 +01:00
boolean hasWheel();
/** Native query of button count */
2004-11-25 23:31:38 +01:00
int getButtonCount();
/**
* Native method to create the mouse.
*/
2004-11-25 23:31:38 +01:00
void createMouse();
/**
* Native method the destroy the mouse
*/
2004-11-25 23:31:38 +01:00
void destroyMouse();
/**
* Native method to poll the mouse
*/
2004-11-25 23:31:38 +01:00
void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons);
/**
* Native method to enable the buffer
*/
2004-11-25 23:31:38 +01:00
void enableMouseBuffer() throws LWJGLException;
/**
* Native method to read the keyboard buffer
2004-11-25 23:31:38 +01:00
*
* @return the total number of events read.
*/
2004-11-25 23:31:38 +01:00
int readMouse(IntBuffer buffer, int buffer_position);
2004-11-25 23:31:38 +01:00
void grabMouse(boolean grab);
/**
* Native function to determine native cursor support
*/
2004-11-25 23:31:38 +01:00
int getNativeCursorCaps();
/** Native method to set the native cursor */
2004-11-25 23:31:38 +01:00
void setNativeCursor(Object handle) throws LWJGLException;
/** Native method returning the minimum cursor size */
2004-11-25 23:31:38 +01:00
int getMinCursorSize();
/** Native method returning the maximum cursor size */
2004-11-25 23:31:38 +01:00
int getMaxCursorSize();
/*
* Keyboard methods
*/
2004-11-25 23:31:38 +01:00
/**
* Native method to create the keyboard
*/
2004-11-25 23:31:38 +01:00
void createKeyboard() throws LWJGLException;
/**
* Native method to destroy the keyboard
*/
2004-11-25 23:31:38 +01:00
void destroyKeyboard();
/**
* Native method to poll the keyboard.
2004-11-25 23:31:38 +01:00
*
* @param keyDownBuffer the address of a 256-byte buffer to place
* key states in.
*/
2004-11-25 23:31:38 +01:00
void pollKeyboard(ByteBuffer keyDownBuffer);
/**
* Native method to read the keyboard buffer
* @return the total number of events read.
*/
2004-11-25 23:31:38 +01:00
int readKeyboard(IntBuffer buffer, int buffer_position);
/**
* Native method to enable the translation buffer
*/
2004-11-25 23:31:38 +01:00
void enableTranslation() throws LWJGLException;
/**
* Native method to enable the buffer
*/
2004-11-25 23:31:38 +01:00
void enableKeyboardBuffer() throws LWJGLException;
int isStateKeySet(int key);
/** Native cursor handles */
2004-11-25 23:31:38 +01:00
Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException;
2004-11-25 23:31:38 +01:00
void destroyCursor(Object cursor_handle);
/* Pbuffer caps */
2004-11-25 23:31:38 +01:00
int getPbufferCaps();
2004-11-25 23:31:38 +01:00
boolean openURL(String url);
}