wined3d: Also flip the point sprite coordinate origin when rendering offscreen.

This commit is contained in:
Henri Verbeet 2010-06-11 16:05:23 +02:00 committed by Alexandre Julliard
parent 67f15e7149
commit b1abafcf8d
4 changed files with 24 additions and 0 deletions

View File

@ -1482,6 +1482,12 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3
checkGLcall("glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)"); checkGLcall("glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)");
} }
if (gl_info->supported[WINED3D_GL_VERSION_2_0])
{
glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_UPPER_LEFT);
checkGLcall("glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_UPPER_LEFT)");
}
if (gl_info->supported[ARB_PROVOKING_VERTEX]) if (gl_info->supported[ARB_PROVOKING_VERTEX])
{ {
GL_EXTCALL(glProvokingVertex(GL_FIRST_VERTEX_CONVENTION)); GL_EXTCALL(glProvokingVertex(GL_FIRST_VERTEX_CONVENTION));
@ -1939,6 +1945,12 @@ static inline void context_set_render_offscreen(struct wined3d_context *context,
{ {
if (context->render_offscreen == offscreen) return; if (context->render_offscreen == offscreen) return;
if (context->gl_info->supported[WINED3D_GL_VERSION_2_0])
{
glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, offscreen ? GL_LOWER_LEFT : GL_UPPER_LEFT);
checkGLcall("glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, ...)");
}
Context_MarkStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION), StateTable); Context_MarkStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION), StateTable);
Context_MarkStateDirty(context, STATE_VDECL, StateTable); Context_MarkStateDirty(context, STATE_VDECL, StateTable);
Context_MarkStateDirty(context, STATE_VIEWPORT, StateTable); Context_MarkStateDirty(context, STATE_VIEWPORT, StateTable);

View File

@ -2287,6 +2287,8 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter)
} }
} }
if (gl_version >= MAKEDWORD_VERSION(2, 0)) gl_info->supported[WINED3D_GL_VERSION_2_0] = TRUE;
if (gl_info->supported[APPLE_FENCE]) if (gl_info->supported[APPLE_FENCE])
{ {
/* GL_NV_fence and GL_APPLE_fence provide the same functionality basically. /* GL_NV_fence and GL_APPLE_fence provide the same functionality basically.

View File

@ -644,6 +644,13 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
} }
} }
if (!context->gl_info->supported[WINED3D_GL_VERSION_2_0] && context->render_offscreen
&& This->stateBlock->renderState[WINED3DRS_POINTSPRITEENABLE]
&& This->stateBlock->gl_primitive_type == GL_POINTS)
{
FIXME("Point sprite coordinate origin switching not supported.\n");
}
/* Ok, we will be updating the screen from here onwards so grab the lock */ /* Ok, we will be updating the screen from here onwards so grab the lock */
ENTER_GL(); ENTER_GL();
{ {

View File

@ -1353,6 +1353,7 @@ void (WINE_GLAPI *glVertex4sv)(const GLshort *v) DECLSPEC_HIDDEN;
void (WINE_GLAPI *glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN; void (WINE_GLAPI *glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN;
void (WINE_GLAPI *glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) DECLSPEC_HIDDEN; void (WINE_GLAPI *glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) DECLSPEC_HIDDEN;
void (WINE_GLAPI *glPointParameterfv)(GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN; void (WINE_GLAPI *glPointParameterfv)(GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN;
void (WINE_GLAPI *glPointParameteri)(GLenum name, GLint value) DECLSPEC_HIDDEN;
/* glFinish and glFlush are always loaded from opengl32.dll, thus they always have /* glFinish and glFlush are always loaded from opengl32.dll, thus they always have
* __stdcall calling convention. * __stdcall calling convention.
@ -1708,6 +1709,7 @@ BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN;
USE_GL_FUNC(glVertexPointer) \ USE_GL_FUNC(glVertexPointer) \
USE_GL_FUNC(glViewport) \ USE_GL_FUNC(glViewport) \
USE_GL_FUNC(glPointParameterfv) \ USE_GL_FUNC(glPointParameterfv) \
USE_GL_FUNC(glPointParameteri) \
#define WGL_FUNCS_GEN \ #define WGL_FUNCS_GEN \
USE_WGL_FUNC(wglCreateContext) \ USE_WGL_FUNC(wglCreateContext) \
@ -1835,6 +1837,7 @@ typedef enum wined3d_gl_extension
WGL_WINE_PIXEL_FORMAT_PASSTHROUGH, WGL_WINE_PIXEL_FORMAT_PASSTHROUGH,
/* Internally used */ /* Internally used */
WINE_NORMALIZED_TEXRECT, WINE_NORMALIZED_TEXRECT,
WINED3D_GL_VERSION_2_0,
WINED3D_GL_EXT_COUNT, WINED3D_GL_EXT_COUNT,
} GL_SupportedExt; } GL_SupportedExt;