Class GLFWWindow
Inheritance
java.lang.Object
GLFWWindow
Syntax
public class GLFWWindow implements Expendable
Constructors
GLFWWindow()
Declaration
GLFWWindow(GLFWWindowProperties props)
Declaration
public GLFWWindow(GLFWWindowProperties props)
Parameters
Type |
Name |
Description |
GLFWWindowProperties |
props |
|
GLFWWindow(int sc_width, int sc_height, String name, String title, boolean fullscreen, int vSync)
Declaration
public GLFWWindow(int sc_width, int sc_height, String name, String title, boolean fullscreen, int vSync)
Parameters
Type |
Name |
Description |
int |
sc_width |
|
int |
sc_height |
|
String |
name |
|
String |
title |
|
boolean |
fullscreen |
|
int |
vSync |
|
GLFWWindow(int sc_width, int sc_height, String name, String title, boolean fullscreen, int vSync, long preferedMonitor)
Initializes the window instance but dose not create the window.
Declaration
public GLFWWindow(int sc_width, int sc_height, String name, String title, boolean fullscreen, int vSync, long preferedMonitor)
Parameters
Type |
Name |
Description |
int |
sc_width |
Width of the window.
|
int |
sc_height |
Height of the window.
|
String |
name |
|
String |
title |
|
boolean |
fullscreen |
|
int |
vSync |
|
long |
preferedMonitor |
|
Fields
GLFW_CLIENT_API
Declaration
public static final int GLFW_CLIENT_API= 0x22001
Field Value
Type |
Description |
final int |
|
GLFW_FOCUSED
Declaration
public static final int GLFW_FOCUSED= 0x20001
Field Value
Type |
Description |
final int |
|
GLFW_RED_BITS
Declaration
public static final int GLFW_RED_BITS= 0x21001
Field Value
Type |
Description |
final int |
|
GLFW_TRUE
Declaration
public static final int GLFW_TRUE= 1
Field Value
Type |
Description |
final int |
|
id
Unique id given to the window, this is used if there are multiple windows with the same names.
Declaration
Field Value
NULL
Declaration
public static final long NULL= 0L
Field Value
Type |
Description |
final long |
|
properties
Properties and preferences
Declaration
protected GLFWWindowProperties properties
Field Value
Type |
Description |
GLFWWindowProperties |
|
videoMode
Declaration
public GLFWVidMode videoMode
Field Value
Type |
Description |
GLFWVidMode |
|
Methods
addGLFWWindowHint(int hint, int value)
Declaration
public void addGLFWWindowHint(int hint, int value)
Parameters
Type |
Name |
Description |
int |
hint |
|
int |
value |
|
addScene(Scene scene)
Declaration
public void addScene(Scene scene)
Parameters
Type |
Name |
Description |
Scene |
scene |
|
addScenes()
Scenes should only be added here, since it is systematically called during the window making process.
Declaration
protected abstract void addScenes()
Returns
Type |
Description |
abstract void |
|
centerWindow()
Centers the window on the monitor it was created on.
Declaration
public void centerWindow()
close()
Called before the window is destroyed with the context, here the user can call last minute methods which require window handles. But Dont call the engine to stop becasue the window is already destroyed after and is removed from GLFW context.
Declaration
protected abstract void close()
Returns
Type |
Description |
abstract void |
|
closeWindow()
Declaration
public void closeWindow()
create()
Creates a new window on the primary monitor with a new context. It is not recommended that you create a window with this method unless you have a way of keeping track of this window and updating rendering etc. Otherwise use GLWFWWindowManager's openWindow function. But this instance if created explicitly through user code and not the engine's window manager this window will not be updated automatically through the core engine.
Declaration
public GLFWWindow create()
Returns
Exceptions
Type |
Condition |
AEGLFWWindowInitializationException |
|
create(long monitor, long share, RenderingEngine rndEng)
Creates the window. Must be called from main thread.
Declaration
public GLFWWindow create(long monitor, long share, RenderingEngine rndEng)
Parameters
Type |
Name |
Description |
long |
monitor |
The monitor to create the window on. NULL will create it on main monitor.
|
long |
share |
The handle of the window the new window will share. NULL will make a new GLContext.
|
RenderingEngine |
rndEng |
|
Returns
Exceptions
Type |
Condition |
AEGLFWWindowInitializationException |
|
create(long monitor, RenderingEngine rndEng)
This monitor will be considered the preferred monitor.
Declaration
public GLFWWindow create(long monitor, RenderingEngine rndEng)
Parameters
Returns
Exceptions
Type |
Condition |
AEGLFWWindowInitializationException |
|
create(long share)
Creates a window on the shared context on the preferred monitor.
Declaration
public GLFWWindow create(long share)
Parameters
Type |
Name |
Description |
long |
share |
|
Returns
Exceptions
Type |
Condition |
AEGLFWWindowInitializationException |
|
create(RenderingEngine rndEng)
Declaration
public GLFWWindow create(RenderingEngine rndEng)
Parameters
Returns
dispose()
Frees callbacks and destroys the window. Also before termination calls the abstract function close to let specified actions be performed before terminating.
Declaration
Overrides
focusWindow()
Declaration
public void focusWindow()
genUniqueID()
Do not call this method it is only called by GLFWWindowManager if there is a conflict of duplicate id's. NOTE: - This will produce a null pointer exception if called externally after creation of the window.
Declaration
public void genUniqueID()
getAssetManager()
Declaration
public AssetManager getAssetManager()
Returns
getAttribute(int attrib)
Returns a boolean for the attribute given to query.
Declaration
public boolean getAttribute(int attrib)
Parameters
Type |
Name |
Description |
int |
attrib |
|
Returns
getCapabilities()
Declaration
public GLCapabilities getCapabilities()
Returns
Type |
Description |
GLCapabilities |
|
getCenter()
Declaration
public Vector2f getCenter()
Returns
getGlfw_Handle()
Declaration
public long getGlfw_Handle()
Returns
getID()
Declaration
Returns
Declaration
Returns
getMonitor()
Declaration
Returns
getPHeight()
Declaration
Returns
getProperties()
Declaration
public GLFWWindowProperties getProperties()
Returns
Type |
Description |
GLFWWindowProperties |
|
getPWidth()
Declaration
Returns
getRenderEngine()
Declaration
public RenderingEngine getRenderEngine()
Returns
getSceneManager()
Declaration
public SceneManager getSceneManager()
Returns
getTitle()
Declaration
Returns
getWindowName()
Declaration
public String getWindowName()
Returns
getWindowOpacity()
Declaration
public float getWindowOpacity()
Returns
hideWindow()
Declaration
Declaration
public void input(float delta)
Parameters
Type |
Name |
Description |
float |
delta |
|
isCloseRequested()
Declaration
public boolean isCloseRequested()
Returns
isFocused()
Declaration
public boolean isFocused()
Returns
isFullscreen()
Declaration
public boolean isFullscreen()
Returns
isMinimized()
Declaration
public boolean isMinimized()
Returns
isvSync()
Declaration
Returns
minimizeWindow()
Declaration
public void minimizeWindow()
post_init()
Same as pre_init except its called after window creation and only attributes should be set here. This method is called after creating and before showing the window.
Declaration
protected abstract void post_init()
Returns
Type |
Description |
abstract void |
|
pre_init()
This is method where window hints can be set. This method is called before the creation of the window and should be the only place to set hints and set other constraints. This method should not be called externally since it can alter the state of the next window that is created.
Declaration
protected abstract void pre_init()
Returns
Type |
Description |
abstract void |
|
render()
Declaration
requestFocus()
Declaration
public void requestFocus()
resetToDefaults()
Declaration
public void resetToDefaults()
restoreWindow()
Declaration
public void restoreWindow()
setAssetStore(AssetStore store)
Declaration
public void setAssetStore(AssetStore store)
Parameters
setAttribute(int attrib, int value)
Sets the attribute and the value given to the current window.
Declaration
public void setAttribute(int attrib, int value)
Parameters
Type |
Name |
Description |
int |
attrib |
|
int |
value |
|
setCursor(CursorI cursor)
Declaration
public void setCursor(CursorI cursor)
Parameters
setCursorType()
Declaration
public void setCursorType()
setFullscreen(boolean fullscreen)
Changes the video mode to full screen or vice versa
Declaration
public void setFullscreen(boolean fullscreen)
Parameters
Type |
Name |
Description |
boolean |
fullscreen |
|
setMonitor()
Moves the window to the monitor described in the preferredMonitor variable or in the setPreferredMonitor() function.
Declaration
setPreferredMonitor(long prfdMntr)
Sets the preferred monitor for this window. meaning what monitor this window is supposed to be on, is going to be on, or the default for it. it can also be used to set the target location for the setMonitor() function.
Declaration
public void setPreferredMonitor(long prfdMntr)
Parameters
Type |
Name |
Description |
long |
prfdMntr |
|
setProperties(GLFWWindowProperties properties)
Declaration
public void setProperties(GLFWWindowProperties properties)
Parameters
Type |
Name |
Description |
GLFWWindowProperties |
properties |
|
setRenderEngine(RenderingEngine rndEng)
Declaration
public void setRenderEngine(RenderingEngine rndEng)
Parameters
setSceneManager(SceneManager sceneManager)
Declaration
public void setSceneManager(SceneManager sceneManager)
Parameters
setSizeLimit(int minwidth, int minheight, int maxwidth, int maxheight)
Sets the size limits of the current created window to ones provided.
Declaration
public void setSizeLimit(int minwidth, int minheight, int maxwidth, int maxheight)
Parameters
Type |
Name |
Description |
int |
minwidth |
|
int |
minheight |
|
int |
maxwidth |
|
int |
maxheight |
|
setTitle(String title)
Declaration
public void setTitle(String title)
Parameters
Type |
Name |
Description |
String |
title |
|
setvSync(int vSync)
Declaration
public void setvSync(int vSync)
Parameters
Type |
Name |
Description |
int |
vSync |
|
setWindowIcon(AEImage... icons)
Icons can be set to null by setting the first element of the array to null to reset to default platform window icon.
Declaration
public void setWindowIcon(AEImage... icons)
Parameters
Type |
Name |
Description |
AEImage... |
icons |
|
setWindowMonitor()
Sets the window onto the preferred monitor as defined in properties and also carries all other setting over so to change the window on the other monitor change the properties before moving.
Declaration
public void setWindowMonitor()
setWindowOpacity(float opacity)
Declaration
public void setWindowOpacity(float opacity)
Parameters
Type |
Name |
Description |
float |
opacity |
|
setWindowPosition(int xpos, int ypos)
Sets the windows position on the preferred monitor.
Declaration
public void setWindowPosition(int xpos, int ypos)
Parameters
Type |
Name |
Description |
int |
xpos |
|
int |
ypos |
|
setWindowPosition(Vector2i newPos)
Declaration
public void setWindowPosition(Vector2i newPos)
Parameters
setWindowTitle(String title)
Declaration
public void setWindowTitle(String title)
Parameters
Type |
Name |
Description |
String |
title |
|
showWindow()
Declaration
swapBuffers()
Declaration
public void swapBuffers()
toggleFullScreen()
Declaration
public void toggleFullScreen()
toggleVSync()
Declaration
public void toggleVSync()
toString()
Declaration
Returns
update(float delta)
Declaration
public void update(float delta)
Parameters
Type |
Name |
Description |
float |
delta |
|