add create vertex buffer for a triangle
This commit is contained in:
+9
-1
@@ -1,4 +1,5 @@
|
||||
#include <Windows.h>
|
||||
#include <random>
|
||||
#include "Window.h"
|
||||
#include "Direct3D.h"
|
||||
#include "Mesh.h"
|
||||
@@ -19,6 +20,9 @@ int WINAPI WinMain(
|
||||
const UINT width = 640;
|
||||
const UINT height = 480;
|
||||
const BOOL isFullscreen = FALSE;
|
||||
const BYTE red = 255;
|
||||
const BYTE green = 255;
|
||||
const BYTE blue = 255;
|
||||
|
||||
UINT error = 0; // error code for identifying errors
|
||||
|
||||
@@ -67,7 +71,11 @@ int WINAPI WinMain(
|
||||
light.update(time.getDeltaTime());
|
||||
|
||||
// 8.2. render objects
|
||||
d3d.beginScene();
|
||||
static std::default_random_engine e;
|
||||
static std::uniform_int_distribution<int> d(0, 255);
|
||||
|
||||
//d3d.beginScene(d(e), d(e), d(e)); //random color
|
||||
d3d.beginScene(red, green, blue);
|
||||
|
||||
light.render(d3d.getDevice());
|
||||
material.render(d3d.getDevice());
|
||||
|
||||
Reference in New Issue
Block a user