File DrawContext.c

FileList > engine > src > rendering > DrawContext.c

Go to the source code of this file

  • #include "DrawContext.h"
  • #include <string.h>
  • #include <glad/glad.h>
  • #include <cglm/cglm.h>
  • #include "ObjectPool.h"
  • #include "Widget.h"
  • #include "DynArray.h"
  • #include "AssertLib.h"
  • #include "PlatformDefs.h"
  • #include "Game2DLayer.h"
  • #include "Log.h"

Classes

Type Name
struct IndexedVertexBuffer
struct Shader
struct VertexBuffer

Public Types

Type Name
enum ShaderType

Public Attributes

Type Name
mat4 gScreenspaceOrtho
struct Shader gUIShader = {0,0,0}
struct Shader gWorldspace2DShader = { 0,0,0 }
const char * uiFrag = /* multi line expression */
const char * uiVert = /* multi line expression */
const char * worldspaceFrag = /* multi line expression */
const char * worldspaceVert = /* multi line expression */

Public Static Attributes

Type Name
const char * gShaderTypeNameLUT = /* multi line expression */

Public Functions

Type Name
void DestroyWorldspaceVertexBuffer (H2DWorldspaceVertexBuffer hBuf)
DrawContext Dr_InitDrawContext ()
void Dr_OnScreenDimsChange (DrawContext * pCtx, int newW, int newH)
void DrawWorldspaceVertexBuffer (H2DWorldspaceVertexBuffer hBuf, size_t indexCount, mat4 view)
OBJECT_POOL (struct VertexBuffer)
void WorldspaceVertexBufferData (HUIVertexBuffer hBuf, Worldspace2DVert * src, size_t size, VertIndexT * indices, u32 numIndices)

Public Static Functions

Type Name
void CreateShader (const char * vert, const char * frag, struct Shader * pShader)
void CreateShaders ()
void DestroyTexture (hTexture tex)
void DestroyUIVertexBuffer (HUIVertexBuffer hBuf)
void DrawUIVertexBuffer (HUIVertexBuffer hBuf, size_t vertexCount)
HUIVertexBuffer NewUIVertexBuffer (int size)
HWorldspaceVertexBuffer NewWorldspaceVertexBuffer (int size)
void SetCurrentAtlas (hTexture atlas)
void TestShaderStatus (GLuint shader, enum ShaderType type)
void UIVertexBufferData (HUIVertexBuffer hBuf, WidgetVertex * src, size_t size)
hTexture UploadTexture (void * src, int channels, int pxWidth, int pxHeight)

Public Types Documentation

enum ShaderType

enum ShaderType {
    ST_Vertex,
    ST_Fragment,
    ST_Program,
    ST_NUM
};

Public Attributes Documentation

variable gScreenspaceOrtho

mat4 gScreenspaceOrtho;

variable gUIShader

struct Shader gUIShader;

variable gWorldspace2DShader

struct Shader gWorldspace2DShader;

variable uiFrag

const char* uiFrag;

variable uiVert

const char* uiVert;

variable worldspaceFrag

const char* worldspaceFrag;

variable worldspaceVert

const char* worldspaceVert;

Public Static Attributes Documentation

variable gShaderTypeNameLUT

const char* gShaderTypeNameLUT[ST_NUM];

Public Functions Documentation

function DestroyWorldspaceVertexBuffer

void DestroyWorldspaceVertexBuffer (
    H2DWorldspaceVertexBuffer hBuf
) 

function Dr_InitDrawContext

DrawContext Dr_InitDrawContext () 

function Dr_OnScreenDimsChange

void Dr_OnScreenDimsChange (
    DrawContext * pCtx,
    int newW,
    int newH
) 

function DrawWorldspaceVertexBuffer

void DrawWorldspaceVertexBuffer (
    H2DWorldspaceVertexBuffer hBuf,
    size_t indexCount,
    mat4 view
) 

function OBJECT_POOL

OBJECT_POOL (
    struct VertexBuffer
) 

function WorldspaceVertexBufferData

void WorldspaceVertexBufferData (
    HUIVertexBuffer hBuf,
    Worldspace2DVert * src,
    size_t size,
    VertIndexT * indices,
    u32 numIndices
) 

Public Static Functions Documentation

function CreateShader

static void CreateShader (
    const char * vert,
    const char * frag,
    struct Shader * pShader
) 

function CreateShaders

static void CreateShaders () 

function DestroyTexture

static void DestroyTexture (
    hTexture tex
) 

function DestroyUIVertexBuffer

static void DestroyUIVertexBuffer (
    HUIVertexBuffer hBuf
) 

function DrawUIVertexBuffer

static void DrawUIVertexBuffer (
    HUIVertexBuffer hBuf,
    size_t vertexCount
) 

function NewUIVertexBuffer

static HUIVertexBuffer NewUIVertexBuffer (
    int size
) 

function NewWorldspaceVertexBuffer

static HWorldspaceVertexBuffer NewWorldspaceVertexBuffer (
    int size
) 

function SetCurrentAtlas

static void SetCurrentAtlas (
    hTexture atlas
) 

function TestShaderStatus

static void TestShaderStatus (
    GLuint shader,
    enum ShaderType type
) 

function UIVertexBufferData

static void UIVertexBufferData (
    HUIVertexBuffer hBuf,
    WidgetVertex * src,
    size_t size
) 

function UploadTexture

static hTexture UploadTexture (
    void * src,
    int channels,
    int pxWidth,
    int pxHeight
) 


The documentation for this class was generated from the following file /home/runner/work/2DFarmingRPG/2DFarmingRPG/Stardew/engine/src/rendering/DrawContext.c