atelier.render.window

Members

Enums

DisplayMode
enum DisplayMode

Window display mode.

Functions

createWindow
void createWindow(Vec2i windowSize, string title)

Create the application window.

destroyWindow
void destroyWindow()

Cleanup the application window.

drawArrow
void drawArrow(Vec2f startPosition, Vec2f endPosition, Color color, float alpha)

Draw an arrow with its head pointing at the end position.

drawCross
void drawCross(Vec2f center, float length, Color color, float alpha)

Draw a vertical cross (like this: +) with the indicated size.

drawFilledRect
void drawFilledRect(Vec2f origin, Vec2f size, Color color, float alpha)

Draw a fully filled rectangle.

drawLine
void drawLine(Vec2f startPosition, Vec2f endPosition, Color color, float alpha)

Draw a line between the two positions.

drawPixel
void drawPixel(Vec2f position, Color color, float alpha)

Draw a rectangle with a size of 1.

drawPoint
void drawPoint(Vec2f position, Color color, float alpha)

Draw a single point.

drawRect
void drawRect(Vec2f origin, Vec2f size, Color color, float alpha)

Draw a rectangle border.

enableAudio
void enableAudio(bool enable)

Enable/Disable audio (Call before creating the window). \ Enabled by default.

getWindowCenter
Vec2f getWindowCenter()

Half of the size of the window in pixels.

getWindowDimensions
Vec2i getWindowDimensions()

Dimensions of the window in pixels.

getWindowDisplay
DisplayMode getWindowDisplay()

Current display mode.

getWindowHeight
int getWindowHeight()

Height of the window in pixels.

getWindowSize
Vec2f getWindowSize()

Size of the window in pixels.

getWindowWidth
int getWindowWidth()

Width of the window in pixels.

isVisible
bool isVisible(Vec2f targetPosition, Vec2f targetSize)

Check if something is inside the actual canvas rendering area.

popCanvas
void popCanvas()

Called after pushCanvas to remove the render canvas from the stack. When there is no canvas on the stack, everything is displayed directly on screen.

pushCanvas
void pushCanvas(Canvas canvas, bool clear)

Push a render canvas on the stack. Everything after that and before the next popCanvas will be rendered onto this. You **must** call popCanvas after that.

renderWindow
void renderWindow()

Render everything on screen.

resizeWindow
void resizeWindow(Vec2i windowSize)

Call this to update canvas size when window's size is changed externally.

setRenderColor
void setRenderColor(Color color, float alpha)

Change the draw color, used internally. Don't bother use it.

setWindowBordered
void setWindowBordered(bool isBordered)

Enable/Disable the borders.

setWindowClearColor
void setWindowClearColor(Color color)

Change the base color of the base canvas.

setWindowCursor
void setWindowCursor(Sprite cursorSprite)

Change the cursor to a custom one and disable the default one.

setWindowDisplay
void setWindowDisplay(DisplayMode displayMode)

Change the display mode between windowed, desktop fullscreen and fullscreen.

setWindowIcon
void setWindowIcon(string path)

Change the icon displayed.

setWindowMaxSize
void setWindowMaxSize(Vec2i size)

The window cannot be resized more than this.

setWindowMinSize
void setWindowMinSize(Vec2i size)

The window cannot be resized less than this.

setWindowResizable
void setWindowResizable(bool isResizable)

Allow the user to resize the window

setWindowSize
void setWindowSize(Vec2i windowSize, bool isLogical)

Update the window size. \ If isLogical is set, the actual window won't be resized, only the canvas will.

setWindowTitle
void setWindowTitle(string title)

Change the actual window title.

showWindow
void showWindow(bool show)

Show/Hide the window. \ Shown by default obviously.

showWindowCursor
void showWindowCursor(bool show)

Enable/Disable the cursor. \ Enabled by default.

transformCanvasSpace
Vec2f transformCanvasSpace(Vec2f pos, Vec2f renderPos)

Change coordinate system from outside to inside the canvas.

transformCanvasSpace
Vec2f transformCanvasSpace(Vec2f pos)

Change coordinate system from outside to insside the canvas.

transformRenderSpace
Vec2f transformRenderSpace(Vec2f pos)

Change coordinate system from inside to outside the canvas.

transformScale
Vec2f transformScale()

Change the scale from outside to inside the canvas.

Static variables

_sdlRenderer
SDL_Renderer* _sdlRenderer;
Undocumented in source.
_sdlWindow
SDL_Window* _sdlWindow;
Undocumented in source.
_windowClearColor
Color _windowClearColor;
Undocumented in source.

Meta

License

Zlib

Authors

Enalye