Stardew Engine
Loading...
Searching...
No Matches
DrawContext.h
Go to the documentation of this file.
1#ifndef DRAWCONTEXT_H
2#define DRAWCONTEXT_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#include "Atlas.h"
8#include "HandleDefs.h"
9
10struct TileMap;
11
13{
14 float x, y;
15 float u, v;
16};
17
19{
20 struct Vert2DTexture v[4];
21};
22
25
27{
28 float x, y;
29 float u, v;
30 float r, g, b, a;
31};
32
37
40
41typedef void(*SetCurrentAtlasFn)(hTexture atlas);
43typedef void(*UIVertexBufferDataFn)(HUIVertexBuffer hBuf, WidgetVertex* src, size_t size);
44typedef void(*DrawUIVertexBufferFn)(HUIVertexBuffer hBuf, size_t vertexCount);
46typedef hTexture(*UploadTextureFn)(void* src, int channels, int pxWidth, int pxHeight);
47typedef void(*DestroyTextureFn)(hTexture tex);
48
49
51
53typedef void(*WorldspaceVertexBufferDataFn)(H2DWorldspaceVertexBuffer hBuf, Worldspace2DVert* src, size_t size, VertIndexT* indices, u32 numIndices);
54typedef void(*DrawWorldspaceVertexBufferFn)(H2DWorldspaceVertexBuffer hBuf, size_t vertexCount, mat4 view);
56
57
75
77void Dr_OnScreenDimsChange(DrawContext* pCtx, int newW, int newH);
78
79#ifdef __cplusplus
80}
81#endif
82
83
84#endif
void(* UIVertexBufferDataFn)(HUIVertexBuffer hBuf, WidgetVertex *src, size_t size)
Definition DrawContext.h:43
hTexture(* UploadTextureFn)(void *src, int channels, int pxWidth, int pxHeight)
Definition DrawContext.h:46
DrawContext Dr_InitDrawContext()
Definition DrawContext.c:386
void(* SetCurrentAtlasFn)(hTexture atlas)
Definition DrawContext.h:41
void(* DrawUIVertexBufferFn)(HUIVertexBuffer hBuf, size_t vertexCount)
Definition DrawContext.h:44
void(* DestroyWorldspaceVertexBufferFn)(H2DWorldspaceVertexBuffer hBuf)
Definition DrawContext.h:55
u32 VertIndexT
Definition DrawContext.h:52
void(* WorldspaceVertexBufferDataFn)(H2DWorldspaceVertexBuffer hBuf, Worldspace2DVert *src, size_t size, VertIndexT *indices, u32 numIndices)
Definition DrawContext.h:53
void(* DestroyUIVertexBufferFn)(HUIVertexBuffer hBuf)
Definition DrawContext.h:45
void(* DrawWorldspaceVertexBufferFn)(H2DWorldspaceVertexBuffer hBuf, size_t vertexCount, mat4 view)
Definition DrawContext.h:54
void(* DestroyTextureFn)(hTexture tex)
Definition DrawContext.h:47
H2DWorldspaceVertexBuffer(* NewWorldspaceVertBufferFn)(int size)
Definition DrawContext.h:50
HUIVertexBuffer(* NewUIVertexBufferFn)(int size)
Definition DrawContext.h:42
void Dr_OnScreenDimsChange(DrawContext *pCtx, int newW, int newH)
Definition DrawContext.c:410
HGeneric hTexture
Definition HandleDefs.h:20
HGeneric HUIVertexBuffer
Definition HandleDefs.h:24
HGeneric H2DWorldspaceVertexBuffer
Definition HandleDefs.h:26
uint32_t u32
Definition IntTypes.h:12
Definition DrawContext.h:59
DrawWorldspaceVertexBufferFn DrawWorldspaceVertexBuffer
Definition DrawContext.h:72
DrawUIVertexBufferFn DrawUIVertexBuffer
Definition DrawContext.h:64
NewWorldspaceVertBufferFn NewWorldspaceVertBuffer
Definition DrawContext.h:70
int screenHeight
Definition DrawContext.h:61
DestroyUIVertexBufferFn DestroyVertexBuffer
Definition DrawContext.h:65
DestroyWorldspaceVertexBufferFn DestroyWorldspaceVertexBuffer
Definition DrawContext.h:73
DestroyTextureFn DestroyTexture
Definition DrawContext.h:68
SetCurrentAtlasFn SetCurrentAtlas
Definition DrawContext.h:66
int screenWidth
Definition DrawContext.h:60
UIVertexBufferDataFn UIVertexBufferData
Definition DrawContext.h:63
NewUIVertexBufferFn NewUIVertexBuffer
Definition DrawContext.h:62
WorldspaceVertexBufferDataFn WorldspaceVertexBufferData
Definition DrawContext.h:71
UploadTextureFn UploadTexture
Definition DrawContext.h:67
Definition Game2DLayer.h:85
Definition DrawContext.h:34
struct Vert2DColourTexture v[4]
Definition DrawContext.h:35
Definition DrawContext.h:27
float y
Definition DrawContext.h:28
float x
Definition DrawContext.h:28
float r
Definition DrawContext.h:30
float a
Definition DrawContext.h:30
float b
Definition DrawContext.h:30
float u
Definition DrawContext.h:29
float v
Definition DrawContext.h:29
float g
Definition DrawContext.h:30
Definition DrawContext.h:19
struct Vert2DTexture v[4]
Definition DrawContext.h:20
Definition DrawContext.h:13
float y
Definition DrawContext.h:14
float v
Definition DrawContext.h:15
float u
Definition DrawContext.h:15
float x
Definition DrawContext.h:14