36 scale->x, 0.0f, 0.0f, 0.0f,
37 0.0f,
scale->y, 0.0f, 0.0f,
38 0.0f, 0.0f,
scale->z, 0.0f,
46 device->legacy_clipspace = clip_space;
74 vp.dwX =
This->viewports.vp2.dwX;
75 vp.dwY =
This->viewports.vp2.dwY;
76 vp.dwHeight =
This->viewports.vp2.dwHeight;
77 vp.dwWidth =
This->viewports.vp2.dwWidth;
81 scale.x = 2.0f /
This->viewports.vp2.dvClipWidth;
82 scale.y = 2.0f /
This->viewports.vp2.dvClipHeight;
83 scale.z = 1.0f / (
This->viewports.vp2.dvMaxZ -
This->viewports.vp2.dvMinZ);
84 offset.x = -2.0f *
This->viewports.vp2.dvClipX /
This->viewports.vp2.dvClipWidth - 1.0f;
85 offset.y = -2.0f *
This->viewports.vp2.dvClipY /
This->viewports.vp2.dvClipHeight + 1.0f;
86 offset.z = -
This->viewports.vp2.dvMinZ / (
This->viewports.vp2.dvMaxZ -
This->viewports.vp2.dvMinZ);
90 vp.dwX =
This->viewports.vp1.dwX;
91 vp.dwY =
This->viewports.vp1.dwY;
92 vp.dwHeight =
This->viewports.vp1.dwHeight;
93 vp.dwWidth =
This->viewports.vp1.dwWidth;
97 scale.x = 2.0f *
This->viewports.vp1.dvScaleX /
This->viewports.vp1.dwWidth;
98 scale.y = 2.0f *
This->viewports.vp1.dvScaleY /
This->viewports.vp1.dwHeight;
117 TRACE(
" - dwSize = %d dwX = %d dwY = %d\n",
119 TRACE(
" - dwWidth = %d dwHeight = %d\n",
121 TRACE(
" - dvScaleX = %f dvScaleY = %f\n",
123 TRACE(
" - dvMaxX = %f dvMaxY = %f\n",
125 TRACE(
" - dvMinZ = %f dvMaxZ = %f\n",
131 TRACE(
" - dwSize = %d dwX = %d dwY = %d\n",
133 TRACE(
" - dwWidth = %d dwHeight = %d\n",
135 TRACE(
" - dvClipX = %f dvClipY = %f\n",
137 TRACE(
" - dvClipWidth = %f dvClipHeight = %f\n",
139 TRACE(
" - dvMinZ = %f dvMaxZ = %f\n",
202 TRACE(
"%p increasing refcount to %u.\n", viewport,
ref);
221 TRACE(
"%p decreasing refcount to %u.\n", viewport,
ref);
247 TRACE(
"iface %p, d3d %p.\n", iface, d3d);
270 TRACE(
"iface %p, data %p.\n", iface, lpData);
295 TRACE(
" returning D3DVIEWPORT :\n");
320 IDirect3DViewport3 *current_viewport;
322 TRACE(
"iface %p, data %p.\n", iface, lpData);
326 TRACE(
" getting D3DVIEWPORT :\n");
339 This->viewports.vp1.dvMinZ = 0.0;
340 This->viewports.vp1.dvMaxZ = 1.0;
342 if (
This->active_device)
344 IDirect3DDevice3 *d3d_device3 = &
This->active_device->IDirect3DDevice3_iface;
404 BOOL activate =
device->current_viewport != viewport;
406 TRACE(
"iface %p, vertex_count %u, data %p, flags %#x, offscreen %p.\n",
420 WARN(
"Transform data is NULL or size is incorrect, returning DDERR_INVALIDPARAMS\n");
425 WARN(
"No clipping flag passed, returning DDERR_INVALIDPARAMS\n");
449 for(
i = 0;
i < dwVertexCount;
i++)
463 outH[
i].u1.
hx = (
x -
device->legacy_clipspace._41 *
w) /
device->legacy_clipspace._11;
464 outH[
i].u2.
hy = (
y -
device->legacy_clipspace._42 *
w) /
device->legacy_clipspace._22;
465 outH[
i].u3.
hz = (
z -
device->legacy_clipspace._43 *
w) /
device->legacy_clipspace._33;
505 out->payload =
in->payload;
508 if (activate &&
device->current_viewport)
532 TRACE(
"iface %p, element_count %u, data %p.\n", iface, element_count,
data);
542 TRACE(
"iface %p, material %#x.\n", iface, material);
548 WARN(
"Invalid material handle %#x.\n", material);
553 TRACE(
"Setting background color : %.8e %.8e %.8e %.8e.\n",
554 m->mat.u.diffuse.u1.r,
m->mat.u.diffuse.u2.g,
555 m->mat.u.diffuse.u3.b,
m->mat.u.diffuse.u4.a);
581 TRACE(
"iface %p, material %p, valid %p.\n", iface, material,
valid);
607 FIXME(
"iface %p, surface %p stub!\n", iface, surface);
627 IDirectDrawSurface **surface,
BOOL *
valid)
629 FIXME(
"iface %p, surface %p, valid %p stub!\n", iface, surface,
valid);
657 IDirect3DViewport3 *current_viewport;
658 IDirect3DDevice3 *d3d_device3;
660 TRACE(
"iface %p, rect_count %u, rects %p, flags %#x.\n", iface, rect_count, rects,
flags);
662 if (!rects || !rect_count)
664 WARN(
"rect_count = %u, rects = %p, ignoring clear\n", rect_count, rects);
669 ERR(
" Trying to clear a viewport not attached to a device!\n");
672 d3d_device3 = &
This->active_device->IDirect3DDevice3_iface;
678 if (!
This->background)
679 WARN(
"No background material set.\n");
682 This->background->mat.u.diffuse.u2.g,
683 This->background->mat.u.diffuse.u3.b,
684 This->background->mat.u.diffuse.u4.a);
727 TRACE(
"iface %p, light %p.\n", iface, lpDirect3DLight);
731 if (
This->num_lights >= 8)
745 This->map_lights |= 1<<
i;
785 TRACE(
"iface %p, light %p.\n", iface, lpDirect3DLight);
789 if (
l->active_viewport != viewport)
791 WARN(
"Light %p active viewport is %p.\n",
l,
l->active_viewport);
798 l->active_viewport =
NULL;
822 IDirect3DLight *lpDirect3DLight, IDirect3DLight **lplpDirect3DLight,
DWORD flags)
829 TRACE(
"iface %p, light %p, next_light %p, flags %#x.\n",
830 iface, lpDirect3DLight, lplpDirect3DLight,
flags);
832 if (!lplpDirect3DLight)
840 if (!
l ||
l->active_viewport != viewport)
843 WARN(
"Light %p active viewport is %p.\n",
l,
l->active_viewport);
872 *lplpDirect3DLight =
NULL;
906 TRACE(
"iface %p, data %p.\n", iface, lpData);
930 TRACE(
" returning D3DVIEWPORT2 :\n");
954 IDirect3DViewport3 *current_viewport;
956 TRACE(
"iface %p, data %p.\n", iface, lpData);
960 TRACE(
" getting D3DVIEWPORT2 :\n");
970 if (
This->active_device)
972 IDirect3DDevice3 *d3d_device3 = &
This->active_device->IDirect3DDevice3_iface;
1002 IDirectDrawSurface4 *surface)
1004 FIXME(
"iface %p, surface %p stub!\n", iface, surface);
1023 IDirectDrawSurface4 **surface,
BOOL *
valid)
1025 FIXME(
"iface %p, surface %p, valid %p stub!\n", iface, surface,
valid);
1051 IDirect3DViewport3 *current_viewport;
1052 IDirect3DDevice3 *d3d_device3;
1054 TRACE(
"iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, depth %.8e, stencil %u.\n",
1057 if (!rects || !rect_count)
1059 WARN(
"rect_count = %u, rects = %p, ignoring clear\n", rect_count, rects);
1067 WARN(
"Trying to clear a viewport not attached to a device.\n");
1071 d3d_device3 = &viewport->
active_device->IDirect3DDevice3_iface;
1125 if (!iface)
return NULL;
1133 if (!iface)
return NULL;
1141 if (!iface)
return NULL;
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
#define IDirect3DLight_AddRef(p)
#define D3DERR_VIEWPORTHASNODEVICE
#define IDirect3DLight_Release(p)
#define IDirect3DViewport3_Release(p)
#define IDirect3DViewport3_AddRef(p)
#define IDirect3DDevice7_Clear(p, a, b, c, d, e, f)
#define IDirect3DDevice3_GetCurrentViewport(p, a)
#define IDirect3DDevice7_SetViewport(p, a)
#define D3DTRANSFORM_UNCLIPPED
#define D3DTRANSFORM_CLIPPED
static HRESULT WINAPI d3d_viewport_Initialize(IDirect3DViewport3 *iface, IDirect3D *d3d)
static HRESULT WINAPI d3d_viewport_GetBackground(IDirect3DViewport3 *iface, D3DMATERIALHANDLE *material, BOOL *valid)
static const struct IDirect3DViewport3Vtbl d3d_viewport_vtbl
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface)
static HRESULT WINAPI d3d_viewport_SetBackground(IDirect3DViewport3 *iface, D3DMATERIALHANDLE material)
void d3d_viewport_init(struct d3d_viewport *viewport, struct ddraw *ddraw)
static HRESULT WINAPI d3d_viewport_Clear2(IDirect3DViewport3 *iface, DWORD rect_count, D3DRECT *rects, DWORD flags, DWORD color, D3DVALUE depth, DWORD stencil)
static ULONG WINAPI d3d_viewport_Release(IDirect3DViewport3 *iface)
static HRESULT WINAPI d3d_viewport_GetBackgroundDepth2(IDirect3DViewport3 *iface, IDirectDrawSurface4 **surface, BOOL *valid)
static ULONG WINAPI d3d_viewport_AddRef(IDirect3DViewport3 *iface)
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport3(IDirect3DViewport3 *iface)
static HRESULT WINAPI d3d_viewport_SetViewport(IDirect3DViewport3 *iface, D3DVIEWPORT *lpData)
static HRESULT WINAPI d3d_viewport_NextLight(IDirect3DViewport3 *iface, IDirect3DLight *lpDirect3DLight, IDirect3DLight **lplpDirect3DLight, DWORD flags)
static void _dump_D3DVIEWPORT(const D3DVIEWPORT *lpvp)
static HRESULT WINAPI d3d_viewport_TransformVertices(IDirect3DViewport3 *iface, DWORD dwVertexCount, D3DTRANSFORMDATA *data, DWORD dwFlags, DWORD *offscreen)
static HRESULT WINAPI d3d_viewport_Clear(IDirect3DViewport3 *iface, DWORD rect_count, D3DRECT *rects, DWORD flags)
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport2(IDirect3DViewport2 *iface)
static HRESULT WINAPI d3d_viewport_QueryInterface(IDirect3DViewport3 *iface, REFIID riid, void **object)
static struct d3d_viewport * impl_from_IDirect3DViewport3(IDirect3DViewport3 *iface)
static HRESULT WINAPI d3d_viewport_SetBackgroundDepth2(IDirect3DViewport3 *iface, IDirectDrawSurface4 *surface)
static HRESULT WINAPI d3d_viewport_AddLight(IDirect3DViewport3 *iface, IDirect3DLight *lpDirect3DLight)
static HRESULT WINAPI d3d_viewport_LightElements(IDirect3DViewport3 *iface, DWORD element_count, D3DLIGHTDATA *data)
static void update_clip_space(struct d3d_device *device, struct wined3d_vec3 *scale, struct wined3d_vec3 *offset)
void viewport_activate(struct d3d_viewport *This, BOOL ignore_lights)
static HRESULT WINAPI d3d_viewport_GetBackgroundDepth(IDirect3DViewport3 *iface, IDirectDrawSurface **surface, BOOL *valid)
static HRESULT WINAPI d3d_viewport_GetViewport2(IDirect3DViewport3 *iface, D3DVIEWPORT2 *lpData)
static HRESULT WINAPI d3d_viewport_GetViewport(IDirect3DViewport3 *iface, D3DVIEWPORT *lpData)
static void _dump_D3DVIEWPORT2(const D3DVIEWPORT2 *lpvp)
static HRESULT WINAPI d3d_viewport_SetBackgroundDepth(IDirect3DViewport3 *iface, IDirectDrawSurface *surface)
static HRESULT WINAPI d3d_viewport_DeleteLight(IDirect3DViewport3 *iface, IDirect3DLight *lpDirect3DLight)
static HRESULT WINAPI d3d_viewport_SetViewport2(IDirect3DViewport3 *iface, D3DVIEWPORT2 *lpData)
void multiply_matrix(D3DMATRIX *dst, const D3DMATRIX *src1, const D3DMATRIX *src2) DECLSPEC_HIDDEN
struct d3d_light * unsafe_impl_from_IDirect3DLight(IDirect3DLight *iface) DECLSPEC_HIDDEN
void light_activate(struct d3d_light *light) DECLSPEC_HIDDEN
void * ddraw_get_object(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type) DECLSPEC_HIDDEN
void light_deactivate(struct d3d_light *light) DECLSPEC_HIDDEN
void CDECL wined3d_device_set_transform(struct wined3d_device *device, enum wined3d_transform_state d3dts, const struct wined3d_matrix *matrix)
void CDECL wined3d_device_get_transform(const struct wined3d_device *device, enum wined3d_transform_state state, struct wined3d_matrix *matrix)
#define D3DTRANSFORMSTATE_VIEW
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLenum GLenum GLenum GLenum scale
GLubyte GLubyte GLubyte GLubyte w
GLint GLfloat GLint stencil
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
#define memcpy(s1, s2, n)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define IsEqualGUID(rguid1, rguid2)
#define DDERR_UNSUPPORTED
#define DDERR_INVALIDPARAMS
#define DDERR_ALREADYINITIALIZED
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
struct d3d_viewport * active_viewport
struct d3d_device * active_device
struct d3d_material * background
IDirect3DViewport3 IDirect3DViewport3_iface
union d3d_viewport::@249 viewports
#define CONTAINING_RECORD(address, type, field)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define WINED3D_TS_WORLD_MATRIX(index)
void WINAPI wined3d_mutex_unlock(void)
void WINAPI wined3d_mutex_lock(void)