int i;
char buf[128];
char cat[8];
- HRESULT hRes;
DGL_pixelFormat *lpPF;
#ifdef _USE_GLD3_WGL
_gldDriver.BuildPixelformatList();
#else
+ HRESULT hRes;
IDirectDraw *lpDD1 = NULL;
IDirectDraw4 *lpDD4 = NULL;
IDirect3D3 *lpD3D3 = NULL;
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
+#include "teximage.h"
#include "texstore.h"
#include "array_cache/acache.h"
#include "swrast_setup/swrast_setup.h"
// Texture object functions
ctx->Driver.BindTexture = NULL;
- ctx->Driver.CreateTexture = NULL; // Not yet implemented by Mesa!;
+ ctx->Driver.NewTextureObject = NULL; // Not yet implemented by Mesa!;
ctx->Driver.DeleteTexture = gld_DeleteTexture_DX7;
ctx->Driver.PrioritizeTexture = NULL;
// State changing functions
ctx->Driver.AlphaFunc = NULL; //gld_AlphaFunc;
- ctx->Driver.BlendFunc = NULL; //gld_BlendFunc;
+ ctx->Driver.BlendFuncSeparate = NULL; //gld_BlendFunc;
ctx->Driver.ClearColor = NULL; //gld_ClearColor;
ctx->Driver.ClearDepth = NULL; //gld_ClearDepth;
ctx->Driver.ClearStencil = NULL; //gld_ClearStencil;
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
//---------------------------------------------------------------------------
-extern struct gl_pipeline_stage _gld_d3d_render_stage;
-extern struct gl_pipeline_stage _gld_mesa_render_stage;
+extern struct tnl_pipeline_stage _gld_d3d_render_stage;
+extern struct tnl_pipeline_stage _gld_mesa_render_stage;
-static const struct gl_pipeline_stage *gld_pipeline[] = {
+static const struct tnl_pipeline_stage *gld_pipeline[] = {
&_gld_d3d_render_stage, // Direct3D TnL
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
GLfloat ex,ey,fx,fy,cc; \
/* Get vars for later */ \
VB = &TNL_CONTEXT(ctx)->vb; \
- vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->Ptr; \
+ vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \
if (VB->SecondaryColorPtr[1]) { \
- vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->Ptr; \
+ vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \
} else { \
vbspec = NULL; \
} \
pV->Position.z = p4f[##v][2];
#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->Ptr; \
+ p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->Ptr; \
+ p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_USE_FLAT_COLOUR_3D \
// We need to flip the data. Yuck.
// Perhaps Mesa has a span packer we can use in future...
for (i=0; i<height; i++) {
- BYTE *pDestRow = (BYTE*)_mesa_image_address(pack, dest, width, height, format, type, 0, i, 0);
+ BYTE *pDestRow = (BYTE*)_mesa_image_address2d(pack, dest, width, height, format, type, 0, i, 0);
BYTE *pSrcRow = (BYTE*)d3dLockedRect.pBits + (d3dLockedRect.Pitch * (height-i-1));
_mesa_transfer_teximage(
ctx,
for (i=0; i<height; i++) {
GLubyte byte;
pBits = (D3DCOLOR*)((BYTE*)ddsd.lpSurface + (i*ddsd.lPitch));
- src = (const GLubyte *) _mesa_image_address(
- &_mesa_native_packing, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP,
+ src = (const GLubyte *) _mesa_image_address2d(
+ &ctx->DefaultPacking, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP,
0, i, 0);
for (j=0; j<(width>>3); j++) {
byte = *src++;
#include "macros.h"
// #include "mem.h"
#include "mtypes.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
static GLboolean gld_d3d_render_stage_run(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
do {
GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_LAST) ; i += length)
+ for (i = 0 ; !(flags & PRIM_END) ; i += length)
{
- flags = VB->Primitive[i];
- length= VB->PrimitiveLength[i];
- ASSERT(length || (flags & PRIM_LAST));
+ flags = VB->Primitive[i].mode;
+ length= VB->Primitive[i].count;
+ ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
static void gld_d3d_render_stage_check(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
//---------------------------------------------------------------------------
-static void gld_d3d_render_stage_dtr( struct gl_pipeline_stage *stage )
+static void gld_d3d_render_stage_dtr( struct tnl_pipeline_stage *stage )
{
}
//---------------------------------------------------------------------------
-const struct gl_pipeline_stage _gld_d3d_render_stage =
+const struct tnl_pipeline_stage _gld_d3d_render_stage =
{
"gld_d3d_render_stage",
(_NEW_BUFFERS |
-/* $Id: gld_vb_mesa_render_dx7.c,v 1.2 2004/07/01 13:14:06 keithw Exp $ */
+/* $Id: gld_vb_mesa_render_dx7.c,v 1.3 2005/04/14 16:58:25 bencrossman Exp $ */
/*
* Mesa 3-D graphics library
#include "macros.h"
// #include "mem.h"
#include "mtypes.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#if defined(USE_IEEE)
#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
-#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
+//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
#else
#define NEGATIVE(x) (x < 0)
-#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
+//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
/* Could just use (x*y<0) except for the flatshading requirements.
* Maybe there's a better way?
*/
static GLboolean _gld_mesa_render_stage_run(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
do {
GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_LAST) ; i += length) {
- flags = VB->Primitive[i];
- length= VB->PrimitiveLength[i];
- ASSERT(length || (flags & PRIM_LAST));
+ for (i = 0 ; !(flags & PRIM_END) ; i += length) {
+ flags = VB->Primitive[i].mode;
+ length= VB->Primitive[i].count;
+ ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
*/
static void _gld_mesa_render_stage_check(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLuint inputs = VERT_BIT_CLIP;
GLuint i;
// Destructor
static void _gld_mesa_render_stage_dtr(
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
}
//---------------------------------------------------------------------------
-const struct gl_pipeline_stage _gld_mesa_render_stage =
+const struct tnl_pipeline_stage _gld_mesa_render_stage =
{
"gld_mesa_render_stage",
(_NEW_BUFFERS |
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
+#include "teximage.h"
#include "texstore.h"
#include "array_cache/acache.h"
#include "swrast_setup/swrast_setup.h"
// Texture object functions
ctx->Driver.BindTexture = NULL;
- ctx->Driver.CreateTexture = NULL; // Not yet implemented by Mesa!;
+ ctx->Driver.NewTextureObject = NULL; // Not yet implemented by Mesa!;
ctx->Driver.DeleteTexture = gld_DeleteTexture_DX8;
ctx->Driver.PrioritizeTexture = NULL;
// State changing functions
ctx->Driver.AlphaFunc = NULL; //gld_AlphaFunc;
- ctx->Driver.BlendFunc = NULL; //gld_BlendFunc;
+ ctx->Driver.BlendFuncSeparate = NULL; //gld_BlendFunc;
ctx->Driver.ClearColor = NULL; //gld_ClearColor;
ctx->Driver.ClearDepth = NULL; //gld_ClearDepth;
ctx->Driver.ClearStencil = NULL; //gld_ClearStencil;
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
//---------------------------------------------------------------------------
-extern struct gl_pipeline_stage _gld_d3d_render_stage;
-extern struct gl_pipeline_stage _gld_mesa_render_stage;
+extern struct tnl_pipeline_stage _gld_d3d_render_stage;
+extern struct tnl_pipeline_stage _gld_mesa_render_stage;
-static const struct gl_pipeline_stage *gld_pipeline[] = {
+static const struct tnl_pipeline_stage *gld_pipeline[] = {
&_gld_d3d_render_stage, // Direct3D TnL
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
GLfloat ex,ey,fx,fy,cc; \
/* Get vars for later */ \
VB = &TNL_CONTEXT(ctx)->vb; \
- vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->Ptr; \
+ vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \
if (VB->SecondaryColorPtr[1]) { \
- vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->Ptr; \
+ vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \
} else { \
vbspec = NULL; \
} \
pV->Position.z = p4f[##v][2];
#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->Ptr; \
+ p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->Ptr; \
+ p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_USE_FLAT_COLOUR_3D \
GLchan rFog, gFog, bFog;
GLchan fR, fG, fB;
const GLfloat f = swv->fog;
- const GLfloat g = 1.0 - f;
+ const GLfloat g = 1.0f - f;
UNCLAMPED_FLOAT_TO_CHAN(rFog, ctx->Fog.Color[RCOMP]);
UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]);
// We need to flip the data. Yuck.
// Perhaps Mesa has a span packer we can use in future...
for (i=0; i<height; i++) {
- BYTE *pDestRow = (BYTE*)_mesa_image_address(pack, dest, width, height, format, type, 0, i, 0);
+ BYTE *pDestRow = (BYTE*)_mesa_image_address2d(pack, dest, width, height, format, type, 0, i, 0);
BYTE *pSrcRow = (BYTE*)d3dLockedRect.pBits + (d3dLockedRect.Pitch * (height-i-1));
_mesa_transfer_teximage(
ctx,
for (i=0; i<height; i++) {
GLubyte byte;
pBits = (D3DCOLOR*)((BYTE*)d3dLockedRect.pBits + (i*d3dLockedRect.Pitch));
- src = (const GLubyte *) _mesa_image_address(
- &_mesa_native_packing, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP,
+ src = (const GLubyte *) _mesa_image_address2d(
+ &ctx->DefaultPacking, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP,
0, i, 0);
for (j=0; j<(width>>3); j++) {
byte = *src++;
#include "macros.h"
// #include "mem.h"
#include "mtypes.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
static GLboolean gld_d3d_render_stage_run(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
do {
GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_LAST) ; i += length)
+ for (i = 0 ; !(flags & PRIM_END) ; i += length)
{
- flags = VB->Primitive[i];
- length= VB->PrimitiveLength[i];
- ASSERT(length || (flags & PRIM_LAST));
+ flags = VB->Primitive[i].mode;
+ length= VB->Primitive[i].count;
+ ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
static void gld_d3d_render_stage_check(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
//---------------------------------------------------------------------------
-static void gld_d3d_render_stage_dtr( struct gl_pipeline_stage *stage )
+static void gld_d3d_render_stage_dtr( struct tnl_pipeline_stage *stage )
{
}
//---------------------------------------------------------------------------
-const struct gl_pipeline_stage _gld_d3d_render_stage =
+const struct tnl_pipeline_stage _gld_d3d_render_stage =
{
"gld_d3d_render_stage",
(_NEW_BUFFERS |
-/* $Id: gld_vb_mesa_render_dx8.c,v 1.2 2004/07/01 13:14:07 keithw Exp $ */
+/* $Id: gld_vb_mesa_render_dx8.c,v 1.3 2005/04/14 16:58:25 bencrossman Exp $ */
/*
* Mesa 3-D graphics library
#include "macros.h"
// #include "mem.h"
#include "mtypes.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#if defined(USE_IEEE)
#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
-#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
+//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
#else
#define NEGATIVE(x) (x < 0)
-#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
+//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
/* Could just use (x*y<0) except for the flatshading requirements.
* Maybe there's a better way?
*/
static GLboolean _gld_mesa_render_stage_run(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
do {
GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_LAST) ; i += length) {
- flags = VB->Primitive[i];
- length= VB->PrimitiveLength[i];
- ASSERT(length || (flags & PRIM_LAST));
+ for (i = 0 ; !(flags & PRIM_END) ; i += length) {
+ flags = VB->Primitive[i].mode;
+ length= VB->Primitive[i].count;
+ ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
*/
static void _gld_mesa_render_stage_check(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLuint inputs = VERT_BIT_CLIP;
GLuint i;
// Destructor
static void _gld_mesa_render_stage_dtr(
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
}
//---------------------------------------------------------------------------
-const struct gl_pipeline_stage _gld_mesa_render_stage =
+const struct tnl_pipeline_stage _gld_mesa_render_stage =
{
"gld_mesa_render_stage",
(_NEW_BUFFERS |
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
+#include "teximage.h"
#include "texstore.h"
#include "array_cache/acache.h"
#include "swrast_setup/swrast_setup.h"
// Texture object functions
ctx->Driver.BindTexture = NULL;
- ctx->Driver.CreateTexture = NULL; // Not yet implemented by Mesa!;
+ ctx->Driver.NewTextureObject = NULL; // Not yet implemented by Mesa!;
ctx->Driver.DeleteTexture = gld_DeleteTexture_DX9;
ctx->Driver.PrioritizeTexture = NULL;
// State changing functions
ctx->Driver.AlphaFunc = NULL; //gld_AlphaFunc;
- ctx->Driver.BlendFunc = NULL; //gld_BlendFunc;
+ ctx->Driver.BlendFuncSeparate = NULL; //gld_BlendFunc;
ctx->Driver.ClearColor = NULL; //gld_ClearColor;
ctx->Driver.ClearDepth = NULL; //gld_ClearDepth;
ctx->Driver.ClearStencil = NULL; //gld_ClearStencil;
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
//---------------------------------------------------------------------------
-extern struct gl_pipeline_stage _gld_d3d_render_stage;
-extern struct gl_pipeline_stage _gld_mesa_render_stage;
+extern struct tnl_pipeline_stage _gld_d3d_render_stage;
+extern struct tnl_pipeline_stage _gld_mesa_render_stage;
-static const struct gl_pipeline_stage *gld_pipeline[] = {
+static const struct tnl_pipeline_stage *gld_pipeline[] = {
&_gld_d3d_render_stage, // Direct3D TnL
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
GLfloat ex,ey,fx,fy,cc; \
/* Get vars for later */ \
VB = &TNL_CONTEXT(ctx)->vb; \
- vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->Ptr; \
+ vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \
if (VB->SecondaryColorPtr[1]) { \
- vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->Ptr; \
+ vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \
} else { \
vbspec = NULL; \
} \
pV->Position.z = p4f[##v][2];
#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->Ptr; \
+ p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \
- p4f = (GLfloat (*)[4])VB->ColorPtr[0]->Ptr; \
+ p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \
dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_USE_FLAT_COLOUR_3D \
// We need to flip the data. Yuck.
// Perhaps Mesa has a span packer we can use in future...
for (i=0; i<height; i++) {
- BYTE *pDestRow = (BYTE*)_mesa_image_address(pack, dest, width, height, format, type, 0, i, 0);
+ BYTE *pDestRow = (BYTE*)_mesa_image_address2d(pack, dest, width, height, format, type, 0, i, 0);
BYTE *pSrcRow = (BYTE*)d3dLockedRect.pBits + (d3dLockedRect.Pitch * (height-i-1));
_mesa_transfer_teximage(
ctx,
for (i=0; i<height; i++) {
GLubyte byte;
pBits = (D3DCOLOR*)((BYTE*)d3dLockedRect.pBits + (i*d3dLockedRect.Pitch));
- src = (const GLubyte *) _mesa_image_address(
- &_mesa_native_packing, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP,
+ src = (const GLubyte *) _mesa_image_address2d(
+ &ctx->DefaultPacking, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP,
0, i, 0);
for (j=0; j<(width>>3); j++) {
byte = *src++;
#include "macros.h"
// #include "mem.h"
#include "mtypes.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
static GLboolean gld_d3d_render_stage_run(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
do {
GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_LAST) ; i += length)
+ for (i = 0 ; !(flags & PRIM_END) ; i += length)
{
- flags = VB->Primitive[i];
- length= VB->PrimitiveLength[i];
- ASSERT(length || (flags & PRIM_LAST));
+ flags = VB->Primitive[i].mode;
+ length= VB->Primitive[i].count;
+ ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
static void gld_d3d_render_stage_check(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
//---------------------------------------------------------------------------
-static void gld_d3d_render_stage_dtr( struct gl_pipeline_stage *stage )
+static void gld_d3d_render_stage_dtr( struct tnl_pipeline_stage *stage )
{
}
//---------------------------------------------------------------------------
-const struct gl_pipeline_stage _gld_d3d_render_stage =
+const struct tnl_pipeline_stage _gld_d3d_render_stage =
{
"gld_d3d_render_stage",
(_NEW_BUFFERS |
-/* $Id: gld_vb_mesa_render_dx9.c,v 1.2 2004/07/01 13:14:07 keithw Exp $ */
+/* $Id: gld_vb_mesa_render_dx9.c,v 1.3 2005/04/14 16:58:25 bencrossman Exp $ */
/*
* Mesa 3-D graphics library
#include "context.h"
#include "macros.h"
#include "mtypes.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#if defined(USE_IEEE)
#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
-#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
+//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
#else
#define NEGATIVE(x) (x < 0)
-#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
+//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
/* Could just use (x*y<0) except for the flatshading requirements.
* Maybe there's a better way?
*/
static GLboolean _gld_mesa_render_stage_run(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
do {
GLuint i, length, flags = 0;
- for (i = 0 ; !(flags & PRIM_LAST) ; i += length) {
- flags = VB->Primitive[i];
- length= VB->PrimitiveLength[i];
- ASSERT(length || (flags & PRIM_LAST));
+ for (i = 0 ; !(flags & PRIM_END) ; i += length) {
+ flags = VB->Primitive[i].mode;
+ length= VB->Primitive[i].count;
+ ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
*/
static void _gld_mesa_render_stage_check(
GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
GLuint inputs = VERT_BIT_CLIP;
GLuint i;
// Destructor
static void _gld_mesa_render_stage_dtr(
- struct gl_pipeline_stage *stage)
+ struct tnl_pipeline_stage *stage)
{
}
//---------------------------------------------------------------------------
-const struct gl_pipeline_stage _gld_mesa_render_stage =
+const struct tnl_pipeline_stage _gld_mesa_render_stage =
{
"gld_mesa_render_stage",
(_NEW_BUFFERS |
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
-#include "mmath.h"
+//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"