#ifndef CLIB_CGX3DRAVE_PROTOS_H
#define CLIB_CGX3DRAVE_PROTOS_H TRUE

/*
**	$VER: cgx3drave_protos.h 1.0 (10-2-99)
**
**	include file for cgx3drave.library
**
**	Copyright © 1998-99 by Vision Factory Development
**      All Rights reserved.
**
*/

#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif

void *CreateGHandleTagList(struct TagItem *tagList);

void *CreateGHandleTags(Tag Tag1, ...);

void DeleteGHandle(void *GHandle);

TQAError QADrawContextNew(	const TQADevice *device,
				const TQARect *rect,
				const TQAClip *clip,
				const TQAEngine *engine,
				unsigned long flags,
				TQADrawContext **newDrawContext);

void QADrawContextDelete(TQADrawContext *drawContext);

TQAError QAColorTableNew(	const TQAEngine *engine,
				TQAColorTableType tableType,
				void *pixelData,
				long transparentIndexFlag,
				TQAColorTable **newTable);

void QAColorTableDelete(const TQAEngine *engine, TQAColorTable *colorTable);


TQAError QATextureNew(		const TQAEngine *engine,
				unsigned long flags,
				TQAImagePixelType pixelType,
				const TQAImage images[],
				TQATexture **newTexture);

TQAError QATextureDetach(const TQAEngine *engine, TQATexture *texture);

TQAError QATextureBindColorTable(const TQAEngine *engine,
				TQATexture *texture,
				TQAColorTable *colorTable);

void QATextureDelete(const TQAEngine *engine, TQATexture *texture);

TQAError QABitmapNew(		const TQAEngine *engine,
				unsigned long flags,
				TQAImagePixelType pixelType,
				const TQAImage *image,
				TQABitmap **newBitmap);

TQAError QABitmapBindColorTable(const TQAEngine *engine,
				TQABitmap *bitmap,
				TQAColorTable *colorTable);

void QABitmapDelete(const TQAEngine *engine, TQABitmap *bitmap);

TQAEngine *QADeviceGetFirstEngine(const TQADevice *device);

TQAEngine *QADeviceGetNextEngine(const TQADevice *device,
				const TQAEngine *currentEngine);

TQAError QAEngineCheckDevice(	const TQAEngine *engine,
				const TQADevice *device);

TQAError QAEngineGestalt(	const TQAEngine *engine,
				TQAGestaltSelector selector,
				void *response);

TQAError QAEngineEnable(	long vendorID,
				long engineID);

TQAError QAEngineDisable(	long vendorID,
				long engineID);

#define QAGetFloat(drawContext,tag) \
		(drawContext)->getFloat(drawContext,tag)

#define QASetFloat(drawContext,tag,newValue) \
		(drawContext)->setFloat(drawContext,tag,newValue)

#define QAGetInt(drawContext,tag) \
		(drawContext)->getInt(drawContext,tag)

#define QASetInt(drawContext,tag,newValue) \
		(drawContext)->setInt(drawContext,tag,newValue)

#define QAGetPtr(drawContext,tag) \
		(drawContext)->getPtr(drawContext,tag)

#define QASetPtr(drawContext,tag,newValue) \
		(drawContext)->setPtr(drawContext,tag,newValue)

#define QADrawPoint(drawContext, v) \
		(drawContext)->drawPoint(drawContext,v)

#define QADrawLine(drawContext,v0,v1) \
		(drawContext)->drawLine(drawContext,v0,v1)

#define QADrawTriGouraud(drawContext,v0,v1,v2,flags) \
		(drawContext)->drawTriGouraud(drawContext,v0,v1,v2,flags)

#define QADrawTriTexture(drawContext,v0,v1,v2,flags) \
		(drawContext)->drawTriTexture(drawContext,v0,v1,v2,flags)

#define QASubmitVerticesGouraud(drawContext,nVertices,vertices) \
		(drawContext)->submitVerticesGouraud(drawContext,nVertices,vertices)

#define QASubmitVerticesTexture(drawContext,nVertices,vertices) \
		(drawContext)->submitVerticesTexture(drawContext,nVertices,vertices)

#define QADrawTriMeshGouraud(drawContext,nTriangle,triangles) \
		(drawContext)->drawTriMeshGouraud(drawContext,nTriangle,triangles)

#define QADrawTriMeshTexture(drawContext,nTriangle,triangles) \
		(drawContext)->drawTriMeshTexture(drawContext,nTriangle,triangles)

#define QADrawVGouraud(drawContext,nVertices,vertexMode,vertices,flags) \
		(drawContext)->drawVGouraud(drawContext,nVertices,vertexMode,vertices,flags)

#define QADrawVTexture(drawContext,nVertices,vertexMode,vertices,flags) \
		(drawContext)->drawVTexture(drawContext,nVertices,vertexMode,vertices,flags)

#define QADrawBitmap(drawContext,v,bitmap) \
		(drawContext)->drawBitmap(drawContext, v, bitmap)

#define QARenderStart(drawContext,dirtyRect,initialContext) \
		(drawContext)->renderStart(drawContext,dirtyRect,initialContext)

#define QARenderEnd(drawContext,modifiedRect) \
		(drawContext)->renderEnd(drawContext,modifiedRect)

#define QARenderAbort(drawContext) \
		(drawContext)->renderAbort(drawContext)

#define QAFlush(drawContext) \
		(drawContext)->flush(drawContext)

#define QASync(drawContext) \
		(drawContext)->sync(drawContext)

#define QAGetNoticeMethod(drawContext, method, completionCallBack, refCon) \
	(drawContext)->getNoticeMethod(drawContext, method, completionCallBack, refCon)

#define QASetNoticeMethod(drawContext, method, completionCallBack, refCon) \
	(drawContext)->setNoticeMethod(drawContext, method, completionCallBack, refCon)

TQAError QARegisterEngine (TQAEngineGetMethod engineGetMethod);

TQAError QARegisterDrawMethod (	TQADrawContext *drawContext,
				TQADrawMethodTag methodTag,
				TQADrawMethod method);

#endif

