All pastes #1736852 Raw Edit

Miscellany

public cpp v1 · immutable
#1736852 ·published 2010-01-04 00:34 UTC
rendered paste body
#include "Window.h"#include "Device.h"#include "Shader.h"INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nShowCmd){	Window	test_window;	Device	test_device;	Shader	*test_shader = 0;	/* init window and device */	if(!test_window.Create(hInstance, "Test Window"))	{		return 0;	}	if(!test_device.Create(test_window.Handle(), hInstance, test_window.Width(), test_window.Height()))	{		return 0;	}	/* init device components */	test_shader = test_device.LoadShader("shader_2d.fx");	/* render loop */	while(test_window.Active())	{		if(!test_window.ProcessNextMessage())		{			test_device.RTClear(.2f, .3f, .5f);			test_device.Render();		}	}	/* destroy device components */	delete test_shader;	/* destroy device and window */	test_device.Destroy();	test_window.Destroy();	return 0;}