//-----------------------------------------------------------------------------
// RGL.ch
//-----------------------------------------------------------------------------
//
// Robert's Graphics Library for Direct3D 8
//
// Copyright (c) 2000 Robert Rose.  All Rights Reserved Worldwide.
// rose@engr.orst.edu | robert_w_rose@hp.com
//

//-----------------------------------------------------------------------------
// Drawing Routines
//-----------------------------------------------------------------------------

struct RGLVertex
{
    FLOAT x, y, z;
    DWORD color;
};

#define D3DFVF_RGLVertex (D3DFVF_XYZ|D3DFVF_DIFFUSE)

HRESULT RGLNewVertexBuffer(LPDIRECT3DVERTEXBUFFER8 *theBuffer, const RGLVertex *vertices, long numVerts);
HRESULT RGLDisposeVertexBuffer(LPDIRECT3DVERTEXBUFFER8 *theBuffer);

HRESULT RGLDrawLine(const RGLVertex theVerts[2]);
#define RGLDrawFacet3(a) RGLDrawFacetN(a,3)
#define RGLDrawFacet4(a) RGLDrawFacetN(a,4)
HRESULT RGLDrawFacetN(const RGLVertex theVerts[], long n);

//-----------------------------------------------------------------------------
// Transformation Routines
//-----------------------------------------------------------------------------

HRESULT RGLLoadIdentity();
HRESULT RGLRotate(float angle, float dx, float dy, float dz);
HRESULT RGLTranslate(float dx, float dy, float dz);
HRESULT RGLScale(float dx, float dy, float dz);
HRESULT RGLLookAt(float eyex, float eyey, float eyez, float vx, float vy, float vz, float upx, float upy, float upz);
HRESULT RGLPerspective(float width, float height, float nearz, float farz);

//-----------------------------------------------------------------------------
// Rendering Routines
//-----------------------------------------------------------------------------

void	RGLBeginRender();
void	RGLEndRender();

//-----------------------------------------------------------------------------
// Startup/Shutdown Routines
//-----------------------------------------------------------------------------

HRESULT RGLInit(HWND hWnd, int width, int height);
void	RGLShutdown();

//-----------------------------------------------------------------------------
// Advanced Routines
//-----------------------------------------------------------------------------

HRESULT RGLSetCullMode(D3DCULL mode);

LPDIRECT3DDEVICE8 RGLGetDevice();