vulkan游戏引擎的renderer_types实现

1.renderer_types.inl

#pragma once

#include "defines.h"

#include "math/math_types.h"

typedef enum renderer_backend_type

{

RENDERER_BACKEND_TYPE_VULKAN,

RENDERER_BACKEND_TYPE_OPENGL,

RENDERER_BACKEND_TYPE_DIRECTX

}renderer_backend_type;

typedef struct global_uniform_object {

// Projection matrix for transforming 3D space to clip space

mat4 projection;

// View matrix for transforming world space to camera space

mat4 view;

// Reserved matrix, can be used for future expansion

mat4 m_reserved0;

// Reserved matrix, can be used for future expansion

mat4 m_reserved1;

} global_uniform_object;

typedef struct renderer_backend{

struct platform_state* plat_state;

u64 frame_number;

b8 (*initialize)(struct renderer_backend* backend,const char* application_name,struct platform_state* plat_state);

void (*shutdown)(struct renderer_backend* backend);

void (*resized)(struct renderer_backend* backend,u16 width,u16 height);

b8 (*begin_frame)(struct renderer_backend* backend,f32 delta_time);

void (*update_global_state)(mat4 projection,mat4 view,vec3 view_position,vec4 ambient_colour,i32 mode);

b8 (*end_frame)(struct renderer_backend* backend,f32 delta_time);

void (*update_object)(mat4 model);

void (*create_texture)(

const char* name,

b8 auto_release,

i32 width,

i32 height,

i32 channel_count,

const u8* pixels,

b8 has_transparency,

struct texture* out_texture

);

void (*destroy_texture)( struct texture* texture);

}renderer_backend;

typedef struct render_packet{

f32 delta_time;

}render_packet;

相关推荐
死也不注释2 小时前
【在Unity游戏开发中Dictionary、List介绍】
数据结构·游戏·unity·游戏引擎·list·游戏程序
沧海归城15 小时前
Unity_XR控制手部动画
unity·游戏引擎·xr
惊鸿醉1 天前
⭐ Unity 异步加载PPT页面 并 首帧无卡顿显示
unity·游戏引擎·powerpoint
还债大湿兄2 天前
3D游戏引擎的“眼睛“:相机系统深度揭秘与技术实现
数码相机·3d·游戏引擎
BuHuaX2 天前
Unity_UI_NGUI_缓动
ui·unity·c#·游戏引擎·游戏策划
DaLiangChen3 天前
Unity 实时 CPU 使用率监控
unity·游戏引擎
cyr___3 天前
Unity教程(二十四)技能系统 投剑技能(中)技能变种实现
学习·游戏·unity·游戏引擎
4 天前
3D碰撞检测系统 基于SAT算法+Burst优化(Unity)
算法·3d·unity·c#·游戏引擎·sat
dzj20214 天前
Unity是如何把3D场景显示到屏幕上的——Unity的渲染过程
3d·unity·游戏引擎·渲染·图形学
不绝1916 天前
ARPG开发流程第一章——方法合集
算法·游戏·unity·游戏引擎