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 intThe frames per seconds.protected KeyboardThe keyboard.protected MouseThe mouse.protected intThe passed application ticks.protected ResManagerThe resource managers.The scheduled tasks executed per loop.protected TimerThe timer.protected WindowThe window. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidclose()static org.lwjgl.glfw.GLFWErrorCallbackcreateErrorCb(org.slf4j.Logger logger) Create the error callback to the logger.voidlaunch()Launch this application.voidonKeyPress(int key, int scancode, int mods) Will be called when a key is pressed.voidonKeyRelease(int key, int scancode, int mods) Will be called when a key is released.voidonKeyRepeat(int key, int scancode, int mods) Will be called when a key is repeated.voidonMouseBtnPress(int btn, int mods) Will be called when a mouse button is pressed.voidonMouseBtnRelease(int btn, int mods) Will be called when a mouse button is released.voidonResize(int width, int height) Called on resizing.voidonScroll(double xoffset, double yoffset) Will be called when a scrolling device is used, such as a mouse wheel or scrolling area of a touchpad.voidschedulePerLoop(int frequency, BooleanSupplier command) Scheduled tasks executed per loop.voidCalled on settingframes.voidUpdate 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) 从类复制的说明:ApplicationCalled 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.
-