|
ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
|
A WindowController manages a ViewController and its descendants within an SDL_Window. More...
#include <WindowController.h>
Public Member Functions | |
| Class * | _WindowController (void) |
| The WindowController archetype. | |
| void | debug (WindowController *self) |
| Debugs the current frame. | |
| WindowController * | initWithDevice (WindowController *self, RenderDevice *device) |
| Initializes this WindowController with the given RenderDevice. | |
| View * | keyResponder (const WindowController *self) |
| Array * | keyResponders (const WindowController *self) |
| View * | nextKeyResponder (const WindowController *self, View *keyResponder) |
Finds the next available keyResponder from the given keyResponder. | |
| View * | previousKeyResponder (const WindowController *self, View *keyResponder) |
Finds the previous available keyResponder from the given keyResponder. | |
| void | render (WindowController *self) |
| Renders the ViewController's View into the RenderDevice's current frame. | |
| void | renderTo (WindowController *self, CommandBuffer *commands, Framebuffer *framebuffer) |
| Renders the ViewController's View into the given Framebuffer. | |
| void | respondToEvent (WindowController *self, const SDL_Event *event) |
| Responds to the given event. | |
| void | setTheme (WindowController *self, Theme *theme) |
| Sets this WindowController's Theme. | |
| void | setViewController (WindowController *self, ViewController *viewController) |
| Sets this WindowController's ViewController. | |
| void | setWindow (WindowController *self, SDL_Window *window) |
| Sets this WindowController's window. | |
| void | toggleDebugger (WindowController *self) |
| Toggles the debugger tools. | |
| View * | touchResponder (const WindowController *self) |
| View * | touchResponder (const WindowController *self, const SDL_Event *event) |
| WindowController * | windowController (SDL_Window *window) |
Data Fields | |
| DebugViewController * | debugViewController |
| The DebugViewController. | |
| Object | object |
| The superclass. | |
| Renderer * | renderer |
| The Renderer. | |
| Theme * | theme |
| The Theme. | |
| ViewController * | viewController |
| The ViewController. | |
| SDL_Window * | window |
| The window. | |
Protected Attributes | |
| WindowControllerInterface * | interface |
| The interface. | |
A WindowController manages a ViewController and its descendants within an SDL_Window.
Definition at line 45 of file WindowController.h.
| Class * _WindowController | ( | void | ) |
The WindowController archetype.
Definition at line 536 of file WindowController.c.
| void debug | ( | WindowController * | self | ) |
Debugs the current frame.
| self | The WindowController. |
Definition at line 76 of file WindowController.c.
| WindowController * initWithDevice | ( | WindowController * | self, |
| RenderDevice * | device | ||
| ) |
Initializes this WindowController with the given RenderDevice.
| self | The WindowController. |
| device | The RenderDevice. |
NULL on error. Definition at line 131 of file WindowController.c.
| View * keyResponder | ( | const WindowController * | self | ) |
| self | The WindowController. |
Definition at line 101 of file WindowController.c.
| Array * keyResponders | ( | const WindowController * | self | ) |
| self | The WindowController. |
Definition at line 119 of file WindowController.c.
| View * nextKeyResponder | ( | const WindowController * | self, |
| View * | keyResponder | ||
| ) |
Finds the next available keyResponder from the given keyResponder.
| self | The WindowController. |
| keyResponder | The current keyResponder. |
Definition at line 188 of file WindowController.c.
| View * previousKeyResponder | ( | const WindowController * | self, |
| View * | keyResponder | ||
| ) |
Finds the previous available keyResponder from the given keyResponder.
| self | The WindowController. |
| keyResponder | The current keyResponder. |
Definition at line 211 of file WindowController.c.
| void render | ( | WindowController * | self | ) |
Renders the ViewController's View into the RenderDevice's current frame.
Convenience over renderTo for the common case of rendering the UI into the device's own current command buffer and framebuffer. Equivalent to $(self, renderTo, device->commands, device->framebuffer).
| self | The WindowController. |
Definition at line 155 of file WindowController.c.
| void renderTo | ( | WindowController * | self, |
| CommandBuffer * | commands, | ||
| Framebuffer * | framebuffer | ||
| ) |
Renders the ViewController's View into the given Framebuffer.
The caller owns commands and is responsible for submitting it after this returns. The UI is composited over whatever is already in the Framebuffer's color texture (SDL_GPU_LOADOP_LOAD), so render your scene into the Framebuffer first.
| self | The WindowController. |
| commands | The frame's CommandBuffer. |
| framebuffer | The Framebuffer to render the UI into. |
Definition at line 167 of file WindowController.c.
| void respondToEvent | ( | WindowController * | self, |
| const SDL_Event * | event | ||
| ) |
Responds to the given event.
| self | The WindowController. |
| event | The event. |
Definition at line 234 of file WindowController.c.
| void setTheme | ( | WindowController * | self, |
| Theme * | theme | ||
| ) |
Sets this WindowController's Theme.
| self | The WindowController. |
| theme | The Theme. |
Definition at line 350 of file WindowController.c.
| void setViewController | ( | WindowController * | self, |
| ViewController * | viewController | ||
| ) |
Sets this WindowController's ViewController.
| self | The WindowController. |
| viewController | The ViewController. |
Definition at line 370 of file WindowController.c.
| void setWindow | ( | WindowController * | self, |
| SDL_Window * | window | ||
| ) |
Sets this WindowController's window.
| self | The WindowController. |
| window | The window. |
Definition at line 402 of file WindowController.c.
| void toggleDebugger | ( | WindowController * | self | ) |
Toggles the debugger tools.
| self | The WindowViewController. |
Definition at line 430 of file WindowController.c.
| View * touchResponder | ( | const WindowController * | self | ) |
| self | The WindowController. |
Definition at line 460 of file WindowController.c.
| View * touchResponder | ( | const WindowController * | self, |
| const SDL_Event * | event | ||
| ) |
| WindowController * windowController | ( | SDL_Window * | window | ) |
| window | The window. |
Definition at line 498 of file WindowController.c.
| DebugViewController* WindowController::debugViewController |
The DebugViewController.
Definition at line 61 of file WindowController.h.
|
protected |
The interface.
Definition at line 56 of file WindowController.h.
| Object WindowController::object |
The superclass.
Definition at line 50 of file WindowController.h.
| Renderer* WindowController::renderer |
The Renderer.
Definition at line 66 of file WindowController.h.
| Theme* WindowController::theme |
The Theme.
Definition at line 71 of file WindowController.h.
| ViewController* WindowController::viewController |
The ViewController.
Definition at line 76 of file WindowController.h.
| SDL_Window* WindowController::window |
The window.
Definition at line 81 of file WindowController.h.