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;

相关推荐
暴走约伯16 分钟前
【VFX工具链源码拆解 01】总体架构:大型项目特效流程的程序化落地
开发语言·经验分享·3d·unity·架构·游戏引擎
Oiiouui19 小时前
Godot-GridGame架构DI容器全局联动设计
架构·游戏引擎·godot
FFFFujige2 天前
【Unity】一个的Dots用Ruhanka踩坑记录
unity·游戏引擎
wgslucky2 天前
Godot UI管理与使用
游戏引擎·godot
Oiiouui2 天前
Godot-GridGame架构屏幕UI层
架构·游戏引擎·godot
凯基迪科技3 天前
Unity游戏加密锁逆向方案、选型与攻防分析
游戏·unity·游戏引擎
xcLeigh4 天前
Unity基础:Destroy与DestroyImmediate——正确销毁游戏物体的方式
游戏·unity·游戏引擎·教程
lllhhh_远方4 天前
unity中URP场景阴影锯齿严重解决方案
unity·游戏引擎
野区捕龙为宠4 天前
Unity 中使用 UnityWebRequest 加载 StreamingAssets 文件夹中的图片
unity·游戏引擎
北里闻箫4 天前
推荐一款游戏引擎,一剑十八年引擎(YiJian18-Engine) - 跨平台2D/3D ECS 游戏引擎
3d·游戏引擎