- fix caps filling to be more in line with what we support

- optimize a little bit the DrawPrimitive function
This commit is contained in:
Lionel Ulmer 2002-11-30 01:49:08 +00:00 committed by Alexandre Julliard
parent 60cba9999c
commit da0b4dc74e
1 changed files with 28 additions and 10 deletions

View File

@ -192,9 +192,22 @@ static void fill_opengl_caps(D3DDEVICEDESC *d1)
d1->dwMinStippleHeight = 1; d1->dwMinStippleHeight = 1;
d1->dwMaxStippleWidth = 32; d1->dwMaxStippleWidth = 32;
d1->dwMaxStippleHeight = 32; d1->dwMaxStippleHeight = 32;
d1->dwMaxTextureRepeat = 16;
d1->dwMaxTextureAspectRatio = 1024;
d1->dwMaxAnisotropy = 0;
d1->dvGuardBandLeft = 0.0;
d1->dvGuardBandRight = 0.0;
d1->dvGuardBandTop = 0.0;
d1->dvGuardBandBottom = 0.0;
d1->dvExtentsAdjust = 0.0;
d1->dwStencilCaps = 0; /* TODO add proper caps according to what OpenGL can do */
d1->dwFVFCaps = D3DFVFCAPS_DONOTSTRIPELEMENTS | 1;
d1->dwTextureOpCaps = 0; /* TODO add proper caps according to OpenGL multi-texture stuff */
d1->wMaxTextureBlendStages = 1; /* TODO add proper caps according to OpenGL multi-texture stuff */
d1->wMaxSimultaneousTextures = 1; /* TODO add proper caps according to OpenGL multi-texture stuff */
} }
#if 0 /* TODO : fix this... */ #if 0 /* TODO : fix this and add multitexturing and other needed stuff */
static void fill_device_capabilities(IDirectDrawImpl* ddraw) static void fill_device_capabilities(IDirectDrawImpl* ddraw)
{ {
x11_dd_private *private = (x11_dd_private *) ddraw->d->private; x11_dd_private *private = (x11_dd_private *) ddraw->d->private;
@ -601,8 +614,11 @@ inline static void draw_primitive(IDirect3DDeviceGLImpl *glThis, DWORD maxvert,
/* Puts GL in the correct lighting mode */ /* Puts GL in the correct lighting mode */
if (glThis->vertex_type != d3dvt) { if (glThis->vertex_type != d3dvt) {
if (glThis->vertex_type == D3DVT_TLVERTEX) { if ((glThis->vertex_type == D3DVT_TLVERTEX) &&
/* Need to put the correct transformation again */ (d3dvt != D3DVT_TLVERTEX)) {
/* Need to put the correct transformation again if we go from Transformed / Lighted
vertices to non-transfromed ones.
*/
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glLoadMatrixf((float *) glThis->world_mat); glLoadMatrixf((float *) glThis->world_mat);
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
@ -625,6 +641,7 @@ inline static void draw_primitive(IDirect3DDeviceGLImpl *glThis, DWORD maxvert,
GLdouble height, width, minZ, maxZ; GLdouble height, width, minZ, maxZ;
TRACE("Transformed - Lighted Vertex\n"); TRACE("Transformed - Lighted Vertex\n");
if (glThis->vertex_type != D3DVT_TLVERTEX) {
/* First, disable lighting */ /* First, disable lighting */
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
@ -633,6 +650,7 @@ inline static void draw_primitive(IDirect3DDeviceGLImpl *glThis, DWORD maxvert,
glLoadIdentity(); glLoadIdentity();
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
}
if (glThis->parent.current_viewport == NULL) { if (glThis->parent.current_viewport == NULL) {
ERR("No current viewport !\n"); ERR("No current viewport !\n");