ngfx::Window

Inherited by ngfx::D3DWindow, ngfx::MTLWindow, ngfx::VKWindow

Public Types

Name
enum @2 { DISPLAY_WIDTH = -1, DISPLAY_HEIGHT = -1}

Public Functions

Name
Window * create(GraphicsContext * graphicsContext, const char * title, std::function< void(Window *thiz)> onWindowCreated, int w =DISPLAY_WIDTH, int h =DISPLAY_HEIGHT)
virtual ~Window()
virtual bool shouldClose() =0
virtual void pollEvents() =0

Public Attributes

Name
int w
int h
Surface * surface
std::function< void()> onUpdate
std::function< void()> onPaint
std::function< void(KeyCode code, InputAction action)> onKey
std::function< void(double xoffset, double yoffset)> onScroll
std::function< void(double x, double y)> onCursorPos
std::function< void(MouseButton button, InputAction action)> onMouseButton

Public Types Documentation

enum @2

Enumerator Value Description
DISPLAY_WIDTH -1
DISPLAY_HEIGHT -1

Public Functions Documentation

function create

static Window * create(
    GraphicsContext * graphicsContext,
    const char * title,
    std::function< void(Window *thiz)> onWindowCreated,
    int w =DISPLAY_WIDTH,
    int h =DISPLAY_HEIGHT
)

function ~Window

inline virtual ~Window()

function shouldClose

virtual bool shouldClose() =0

Reimplemented by: ngfx::WWindow::shouldClose, ngfx::MTLWindow::shouldClose

function pollEvents

virtual void pollEvents() =0

Reimplemented by: ngfx::WWindow::pollEvents, ngfx::MTLWindow::pollEvents

Public Attributes Documentation

variable w

int w;

variable h

int h;

variable surface

Surface * surface = nullptr;

variable onUpdate

std::function< void()> onUpdate = nullptr;

variable onPaint

std::function< void()> onPaint = nullptr;

variable onKey

std::function< void(KeyCode code, InputAction action)> onKey = nullptr;

variable onScroll

std::function< void(double xoffset, double yoffset)> onScroll = nullptr;

variable onCursorPos

std::function< void(double x, double y)> onCursorPos = nullptr;

variable onMouseButton

std::function< void(MouseButton button, InputAction action)> onMouseButton =
      nullptr;

Updated on 3 April 2021 at 20:21:51 PDT