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;

相关推荐
GLDbalala4 小时前
Unity基于自定义管线实现经典经验光照模型
unity·游戏引擎
心疼你的一切6 小时前
Unity异步编程神器:Unitask库深度解析(功能+实战案例+API全指南)
深度学习·unity·c#·游戏引擎·unitask
呆呆敲代码的小Y8 小时前
【Unity 实用工具篇】 | Book Page Curl 快速实现翻书效果
游戏·unity·游戏引擎·u3d·免费游戏·翻书插件
星夜泊客2 天前
C# 基础:为什么类可以在静态方法中创建自己的实例?
开发语言·经验分享·笔记·unity·c#·游戏引擎
心前阳光2 天前
Unity 模拟父子关系
android·unity·游戏引擎
咸鱼永不翻身2 天前
Unity视频资源压缩详解
unity·游戏引擎·音视频
nnsix3 天前
Unity Physics.Raycast的 QueryTriggerInteraction枚举作用
unity·游戏引擎
ۓ明哲ڪ3 天前
Unity功能——创建新脚本时自动添加自定义头注释
unity·游戏引擎
熬夜敲代码的小N3 天前
Unity大场景卡顿“急救包”:从诊断到落地的全栈优化方案
java·unity·游戏引擎
派葛穆3 天前
Unity-realvirtual-S7通讯快速配置(未完结)
unity·游戏引擎