java.lang.Object
org.overrun.swgl.core.Application
org.overrun.swgl.core.GlfwApplication
- 所有已实现的接口:
AutoCloseable
,Runnable
,Mouse.Callback
A swgl application implement by GLFW.
- 从以下版本开始:
- 0.1.0
- 作者:
- squid233
-
字段概要
修饰符和类型字段说明protected int
The frames per seconds.protected Keyboard
The keyboard.protected Mouse
The mouse.protected int
The passed application ticks.protected ResManager
The resource managers.The scheduled tasks executed per loop.protected Timer
The timer.protected Window
The window. -
构造器概要
-
方法概要
修饰符和类型方法说明void
close()
static org.lwjgl.glfw.GLFWErrorCallback
createErrorCb
(org.slf4j.Logger logger) Create the error callback to the logger.void
launch()
Launch this application.void
onKeyPress
(int key, int scancode, int mods) Will be called when a key is pressed.void
onKeyRelease
(int key, int scancode, int mods) Will be called when a key is released.void
onKeyRepeat
(int key, int scancode, int mods) Will be called when a key is repeated.void
onMouseBtnPress
(int btn, int mods) Will be called when a mouse button is pressed.void
onMouseBtnRelease
(int btn, int mods) Will be called when a mouse button is released.void
onResize
(int width, int height) Called on resizing.void
onScroll
(double xoffset, double yoffset) Will be called when a scrolling device is used, such as a mouse wheel or scrolling area of a touchpad.void
schedulePerLoop
(int frequency, BooleanSupplier command) Scheduled tasks executed per loop.void
Called on settingframes
.void
Update the time and ticking.
-
字段详细资料
-
window
The window. -
keyboard
The keyboard. -
mouse
The mouse. -
timer
The timer. -
frames
protected int framesThe frames per seconds. -
resManager
The resource managers. -
scheduledPerLoopTasks
The scheduled tasks executed per loop. -
passedAppTicks
protected int passedAppTicksThe passed application ticks.
-
-
构造器详细资料
-
GlfwApplication
public GlfwApplication()
-
-
方法详细资料
-
updateTime
public void updateTime()Update the time and ticking. -
createErrorCb
public static org.lwjgl.glfw.GLFWErrorCallback createErrorCb(org.slf4j.Logger logger) Create the error callback to the logger.- 参数:
logger
- the logger- 返回:
- the error callback
- 从以下版本开始:
- 0.2.0
-
launch
public void launch()Launch this application. -
close
- 抛出:
Exception
-
schedulePerLoop
Scheduled tasks executed per loop.- 参数:
frequency
- The frequency in ticks.command
- The command to be executed.
-
onKeyPress
public void onKeyPress(int key, int scancode, int mods) Will be called when a key is pressed.- 参数:
key
- the keyboard key that was pressedscancode
- the platform-specific scancode of the keymods
- bitfield describing which modifiers keys were held down
-
onKeyRelease
public void onKeyRelease(int key, int scancode, int mods) Will be called when a key is released.- 参数:
key
- the keyboard key that was releasedscancode
- the platform-specific scancode of the keymods
- bitfield describing which modifiers keys were held down
-
onKeyRepeat
public void onKeyRepeat(int key, int scancode, int mods) Will be called when a key is repeated.- 参数:
key
- the keyboard keyscancode
- the platform-specific scancode of the keymods
- bitfield describing which modifiers keys were held down
-
onMouseBtnPress
public void onMouseBtnPress(int btn, int mods) Will be called when a mouse button is pressed.- 参数:
btn
- the mouse button that was pressedmods
- bitfield describing which modifiers keys were held down
-
onMouseBtnRelease
public void onMouseBtnRelease(int btn, int mods) Will be called when a mouse button is released.- 参数:
btn
- the mouse button that was releasedmods
- bitfield describing which modifiers keys were held down
-
onScroll
public void onScroll(double xoffset, double yoffset) Will be called when a scrolling device is used, such as a mouse wheel or scrolling area of a touchpad.- 参数:
xoffset
- the scroll offset along the x-axisyoffset
- the scroll offset along the y-axis
-
onResize
public void onResize(int width, int height) 从类复制的说明:Application
Called on resizing. You can update the viewport here.- 覆盖:
onResize
在类中Application
- 参数:
width
- The new width.height
- The new height.
-
settingFrames
public void settingFrames()Called on settingframes
.
-