Add texture loading

Add uv mapping
This commit is contained in:
2026-11-20 11:06:43 +01:00
parent b84f9c1052
commit 491367dfa8
10 changed files with 772 additions and 12 deletions
+9 -4
View File
@@ -1,7 +1,7 @@
#pragma once
#include <d3d9.h>
#define FVF D3DFVF_XYZ | D3DFVF_DIFFUSE
#define FVF D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1
struct Vertex
{
@@ -13,7 +13,12 @@ struct Vertex
// color
D3DCOLOR color;
Vertex() : x(0.0f), y(0.0f), z(0.0f), color(0xffffffff) {}
Vertex(float x, float y, float z) : x(x), y(y), z(z), color(0xffffffff) {}
Vertex(float x, float y, float z, UINT r, UINT g, UINT b) : x(x), y(y), z(z), color(D3DCOLOR_XRGB(r, g, b)) {}
// texture coordinates
float u;
float v;
Vertex() : x(0.0f), y(0.0f), z(0.0f), color(0xffffffff), u(0.0f), v(0.0f) {}
Vertex(float x, float y, float z) : x(x), y(y), z(z), color(0xffffffff), u(0.0f), v(0.0f) {}
Vertex(float x, float y, float z, UINT r, UINT g, UINT b) : x(x), y(y), z(z), color(D3DCOLOR_XRGB(r, g, b)), u(0.0f), v(0.0f) {}
Vertex(float x, float y, float z, float u, float v) : x(x), y(y), z(z), color(0xffffffff), u(u), v(v) {}
};