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;

相关推荐
辻弋2013 天前
五年前的旅行视频糊成马赛克?Video2X用Real-ESRGAN逐帧重建细节,但只支持Windows、集显用户建议直接放弃
服务器·数据库·windows·游戏引擎·电脑
淡海水7 天前
02-02-原理篇-分代GC
算法·unity·c#·游戏引擎·.net·gc
淡海水7 天前
02-03-原理篇-大对象堆
unity·c#·游戏引擎·.net·gc
郝学胜-神的一滴8 天前
C++ Templates 01:拨开迷雾,读懂C++模板经典著作
开发语言·c++·程序人生·游戏·游戏引擎·软件构建
淡海水8 天前
02-01-原理篇-Mark-Sweep与变种算法
算法·unity·c#·游戏引擎·.net·gc
babywang09 天前
Unity笔记--AssetBundle详解
unity·游戏引擎
魔士于安9 天前
经典Game
游戏·游戏引擎·贴图·技术美术·模型
淡海水9 天前
01-04-认知篇-Unity内存全景
unity·c#·游戏引擎·.net·gc
598866753@qq.com9 天前
Codex与Unity
unity·游戏引擎
淡海水9 天前
01-03-认知篇-C#内存模型深度解析
unity·c#·游戏引擎·.net·gc