class Tessell::Platform::SDL2::Host

Overview

OpenGL 2.1 兼容宿主(plan §3.5:GLBackend 固定管线路径不变)。

Defined in:

tessell/platform/sdl2.cr

Constructors

Instance Method Summary

Instance methods inherited from class Tessell::Platform::Host

clipboard : Clipboard clipboard, close : Nil close, delay(ms : Int32) : Nil delay, ime : ImeSupport ime, poll_events(sink : Array(Tessell::Input::Event)) : Bool poll_events, present : Nil present, resized? : Bool resized?, scale : Float32 scale, ticks_ms : Int64 ticks_ms, title : String title, viewport : Tessell::Rect viewport

Constructor Detail

def self.new(title : String, width : Int32, height : Int32) #

[View source]

Instance Method Detail

def clipboard : Platform::Clipboard #
Description copied from class Tessell::Platform::Host

X1 扩展(issue #61 / plan §3.3):剪贴板与 IME 能力表。


[View source]
def close : Nil #

[View source]
def context : Pointer(Void) #

[View source]
def delay(ms : Int32) : Nil #

[View source]
def drawable_height : Int32 #

[View source]
def drawable_width : Int32 #

[View source]

SDL2 只稳定提供 SDL_TEXTINPUT(committed text);预编辑 Unsupported。


[View source]
def logical_height : Int32 #

[View source]
def logical_width : Int32 #

[View source]
def make_current : Nil #

[View source]
def poll_events(sink : Array(Tessell::Input::Event)) : Bool #
Description copied from class Tessell::Platform::Host

泵一批输入事件进 sink(复用调用方缓冲);返回 false = 宿主要求退出。


[View source]
def present : Nil #
Description copied from class Tessell::Platform::Host

呈现当前帧(swap buffers / 位块传输)。


[View source]
def quit_requested? : Bool #

[View source]
def refresh_sizes : Nil #

[View source]
def resized? : Bool #

消费式 resize 通知(issue #61 X1)。


[View source]
def scale : Float32 #

[View source]
def screenshot(path : String) : Nil #

GL 像素回读截图(PPM;测试/示例工具口径,plan §3.3 明确不进组件 API)。


[View source]
def ticks_ms : Int64 #
Description copied from class Tessell::Platform::Host

帧循环辅助:平台侧时间源(manual clock 的宿主来源)。


[View source]
def title : String #

[View source]
def viewport : Tessell::Rect #

[View source]
def window : Pointer(Void) #

[View source]