somewhat working material system
This commit is contained in:
@@ -26,6 +26,7 @@ DECLARE_BUILD_STAGE(engine)
|
||||
compileProject.includeDirectories = {
|
||||
"../public",
|
||||
"../external/SDL/include",
|
||||
"../external/cglm/include",
|
||||
FUNNYSTDLIB"public",
|
||||
};
|
||||
compileProject.bFPIC = true;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "tier0/commandline.h"
|
||||
#include "tier0/mem.h"
|
||||
#include "sv_dll.h"
|
||||
#include "cglm/cglm.h"
|
||||
|
||||
IRenderContext *g_pRenderContext;
|
||||
IFileSystem *filesystem;
|
||||
@@ -47,14 +48,15 @@ extern "C" void FunnyMain( int argc, char **argv )
|
||||
IVertexBuffer *pVertices = NULL;
|
||||
|
||||
float vertices[18] = {
|
||||
-0.5, -0.5, 0,
|
||||
0.5, -0.5, 0,
|
||||
-0.5, 0.5, 0,
|
||||
-0.5, 0.5, 0,
|
||||
0.5, -0.5, 0,
|
||||
0.5, 0.5, 0
|
||||
|
||||
-0.5, -0.5, 0.5,
|
||||
0.5, -0.5, 0.5,
|
||||
-0.5, 0.5, 0.5,
|
||||
-0.5, 0.5, 0.5,
|
||||
0.5, -0.5, 0.5,
|
||||
0.5, 0.5, 0.5
|
||||
};
|
||||
mat4 mat;
|
||||
glm_mat4_identity(mat);
|
||||
|
||||
pVertices = g_pRenderContext->CreateVertexBuffer(72);
|
||||
|
||||
@@ -63,6 +65,9 @@ extern "C" void FunnyMain( int argc, char **argv )
|
||||
pVertices->Unmap();
|
||||
|
||||
pCameraInfoBuffer = g_pRenderContext->CreateConstantBuffer(64);
|
||||
pMapped = pCameraInfoBuffer->Map();
|
||||
V_memcpy(pMapped, mat, 64);
|
||||
pCameraInfoBuffer->Unmap();
|
||||
|
||||
pShader = g_pRenderContext->CreateShader("game/core/shaders/flat.shader_c");
|
||||
pShader->AddLayout(0, 12);
|
||||
|
||||
Reference in New Issue
Block a user