2000-04-09 16:30:50 +02:00
|
|
|
/* MESA private include file
|
2002-03-10 00:29:33 +01:00
|
|
|
* Copyright (c) 1998 Lionel ULMER
|
|
|
|
*
|
|
|
|
* This file contains all structures that are not exported
|
|
|
|
* through d3d.h and all common macros.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
2000-04-09 16:30:50 +02:00
|
|
|
|
|
|
|
#ifndef __GRAPHICS_WINE_MESA_PRIVATE_H
|
|
|
|
#define __GRAPHICS_WINE_MESA_PRIVATE_H
|
|
|
|
|
|
|
|
#include "d3d_private.h"
|
|
|
|
|
2002-09-29 20:05:32 +02:00
|
|
|
#ifdef HAVE_OPENGL
|
|
|
|
|
2002-09-25 02:29:56 +02:00
|
|
|
#undef APIENTRY
|
|
|
|
#undef CALLBACK
|
|
|
|
#undef WINAPI
|
|
|
|
|
|
|
|
#define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */
|
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GL/glx.h>
|
|
|
|
#ifdef HAVE_GL_GLEXT_H
|
|
|
|
# include <GL/glext.h>
|
|
|
|
#endif
|
|
|
|
#undef XMD_H
|
|
|
|
|
|
|
|
#undef APIENTRY
|
|
|
|
#undef CALLBACK
|
|
|
|
#undef WINAPI
|
|
|
|
|
|
|
|
/* Redefines the constants */
|
|
|
|
#define CALLBACK __stdcall
|
|
|
|
#define WINAPI __stdcall
|
|
|
|
#define APIENTRY WINAPI
|
|
|
|
|
|
|
|
/* X11 locking */
|
|
|
|
|
|
|
|
extern void (*wine_tsx11_lock_ptr)(void);
|
|
|
|
extern void (*wine_tsx11_unlock_ptr)(void);
|
|
|
|
|
|
|
|
/* As GLX relies on X, this is needed */
|
|
|
|
#define ENTER_GL() wine_tsx11_lock_ptr()
|
|
|
|
#define LEAVE_GL() wine_tsx11_unlock_ptr()
|
|
|
|
|
2002-11-21 22:04:16 +01:00
|
|
|
extern const GUID IID_D3DDEVICE_OpenGL;
|
2000-04-09 16:30:50 +02:00
|
|
|
|
2002-11-21 22:04:16 +01:00
|
|
|
typedef struct IDirect3DGLImpl
|
2000-04-09 16:30:50 +02:00
|
|
|
{
|
2002-11-21 22:04:16 +01:00
|
|
|
struct IDirect3DImpl parent;
|
2003-01-03 20:10:48 +01:00
|
|
|
DWORD free_lights;
|
2002-11-21 22:04:16 +01:00
|
|
|
void (*light_released)(IDirect3DImpl *, GLenum light_num);
|
|
|
|
} IDirect3DGLImpl;
|
2000-04-09 16:30:50 +02:00
|
|
|
|
2002-11-21 22:04:16 +01:00
|
|
|
typedef struct IDirect3DLightGLImpl
|
2000-04-09 16:30:50 +02:00
|
|
|
{
|
2002-11-21 22:04:16 +01:00
|
|
|
struct IDirect3DLightImpl parent;
|
|
|
|
GLenum light_num;
|
|
|
|
} IDirect3DLightGLImpl;
|
2000-04-09 16:30:50 +02:00
|
|
|
|
2002-12-15 02:17:59 +01:00
|
|
|
/* This structure is used for the 'private' field of the IDirectDrawSurfaceImpl structure */
|
2002-11-21 22:04:16 +01:00
|
|
|
typedef struct IDirect3DTextureGLImpl
|
2000-04-09 16:30:50 +02:00
|
|
|
{
|
2002-11-21 22:04:16 +01:00
|
|
|
GLuint tex_name;
|
2002-12-15 02:17:59 +01:00
|
|
|
BOOLEAN loaded; /* For the moment, this is here.. Should be part of surface management though */
|
2003-01-03 22:17:47 +01:00
|
|
|
|
|
|
|
/* Texture upload management */
|
|
|
|
BOOLEAN initial_upload_done;
|
|
|
|
BOOLEAN dirty_flag;
|
|
|
|
|
2002-12-15 02:17:59 +01:00
|
|
|
/* This is for now used to override 'standard' surface stuff to be as transparent as possible */
|
|
|
|
void (*final_release)(struct IDirectDrawSurfaceImpl *This);
|
|
|
|
void (*lock_update)(IDirectDrawSurfaceImpl* This, LPCRECT pRect, DWORD dwFlags);
|
|
|
|
void (*unlock_update)(IDirectDrawSurfaceImpl* This, LPCRECT pRect);
|
2003-01-02 20:59:49 +01:00
|
|
|
void (*set_palette)(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* pal);
|
2002-11-21 22:04:16 +01:00
|
|
|
} IDirect3DTextureGLImpl;
|
|
|
|
|
2003-01-03 22:05:38 +01:00
|
|
|
typedef enum {
|
|
|
|
GL_TRANSFORM_NONE = 0,
|
|
|
|
GL_TRANSFORM_ORTHO,
|
|
|
|
GL_TRANSFORM_NORMAL,
|
|
|
|
GL_TRANSFORM_VERTEXBUFFER
|
|
|
|
} GL_TRANSFORM_STATE;
|
|
|
|
|
2002-11-21 22:04:16 +01:00
|
|
|
typedef struct IDirect3DDeviceGLImpl
|
|
|
|
{
|
|
|
|
struct IDirect3DDeviceImpl parent;
|
|
|
|
|
|
|
|
GLXContext gl_context;
|
|
|
|
|
|
|
|
/* The last type of vertex drawn */
|
2003-01-03 22:05:38 +01:00
|
|
|
GL_TRANSFORM_STATE transform_state;
|
2002-11-21 22:04:16 +01:00
|
|
|
|
2003-02-12 22:26:05 +01:00
|
|
|
/* Used to handle fogging faster... */
|
|
|
|
BYTE fog_table[3 * 0x10000]; /* 3 is for R, G and B
|
|
|
|
0x10000 is 0xFF for the vertex color and
|
|
|
|
0xFF for the fog intensity */
|
|
|
|
|
2002-11-21 22:04:16 +01:00
|
|
|
Display *display;
|
|
|
|
Drawable drawable;
|
|
|
|
} IDirect3DDeviceGLImpl;
|
|
|
|
|
2003-01-03 22:07:22 +01:00
|
|
|
/* This is for the OpenGL additions... */
|
|
|
|
typedef struct {
|
|
|
|
struct IDirect3DVertexBufferImpl parent;
|
|
|
|
|
|
|
|
DWORD dwVertexTypeDesc;
|
|
|
|
D3DMATRIX world_mat, view_mat, proj_mat;
|
|
|
|
LPVOID vertices;
|
|
|
|
} IDirect3DVertexBufferGLImpl;
|
|
|
|
|
2002-11-21 22:04:16 +01:00
|
|
|
/* All non-static functions 'exported' by various sub-objects */
|
|
|
|
extern HRESULT direct3d_create(IDirect3DImpl **obj, IDirectDrawImpl *ddraw);
|
2003-01-02 20:39:57 +01:00
|
|
|
extern HRESULT d3dtexture_create(IDirect3DImpl *d3d, IDirectDrawSurfaceImpl *surf, BOOLEAN at_creation, IDirectDrawSurfaceImpl *main_surf);
|
2002-11-21 22:04:16 +01:00
|
|
|
extern HRESULT d3dlight_create(IDirect3DLightImpl **obj, IDirect3DImpl *d3d, GLenum light_num);
|
|
|
|
extern HRESULT d3dexecutebuffer_create(IDirect3DExecuteBufferImpl **obj, IDirect3DImpl *d3d, IDirect3DDeviceImpl *d3ddev, LPD3DEXECUTEBUFFERDESC lpDesc);
|
|
|
|
extern HRESULT d3dmaterial_create(IDirect3DMaterialImpl **obj, IDirect3DImpl *d3d);
|
|
|
|
extern HRESULT d3dviewport_create(IDirect3DViewportImpl **obj, IDirect3DImpl *d3d);
|
2002-11-30 20:27:19 +01:00
|
|
|
extern HRESULT d3dvertexbuffer_create(IDirect3DVertexBufferImpl **obj, IDirect3DImpl *d3d, LPD3DVERTEXBUFFERDESC lpD3DVertBufDesc, DWORD dwFlags);
|
2002-11-21 22:04:16 +01:00
|
|
|
extern HRESULT d3ddevice_create(IDirect3DDeviceImpl **obj, IDirect3DImpl *d3d, IDirectDrawSurfaceImpl *surface);
|
|
|
|
|
|
|
|
/* Used for Direct3D to request the device to enumerate itself */
|
2002-12-05 20:07:59 +01:00
|
|
|
extern HRESULT d3ddevice_enumerate(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) ;
|
2002-11-30 20:21:42 +01:00
|
|
|
extern HRESULT d3ddevice_enumerate7(LPD3DENUMDEVICESCALLBACK7 cb, LPVOID context) ;
|
2002-12-05 20:07:59 +01:00
|
|
|
extern HRESULT d3ddevice_find(IDirect3DImpl *d3d, LPD3DFINDDEVICESEARCH lpD3DDFS, LPD3DFINDDEVICERESULT lplpD3DDevice);
|
2000-04-09 16:30:50 +02:00
|
|
|
|
2003-01-03 22:17:47 +01:00
|
|
|
/* Used to upload the texture */
|
|
|
|
extern HRESULT gltex_upload_texture(IDirectDrawSurfaceImpl *This) ;
|
|
|
|
|
2003-01-05 21:28:35 +01:00
|
|
|
/* Used to set-up our orthographic projection */
|
|
|
|
extern void d3ddevice_set_ortho(IDirect3DDeviceImpl *This) ;
|
|
|
|
|
2003-01-08 00:08:31 +01:00
|
|
|
/* Rendering state management functions */
|
|
|
|
extern void set_render_state(IDirect3DDeviceImpl* This, D3DRENDERSTATETYPE dwRenderStateType, STATEBLOCK *lpStateBlock);
|
|
|
|
extern void store_render_state(IDirect3DDeviceImpl *This, D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState, STATEBLOCK* lpStateBlock);
|
|
|
|
extern void get_render_state(IDirect3DDeviceImpl *This, D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState, STATEBLOCK* lpStateBlock);
|
|
|
|
extern void apply_render_state(IDirect3DDeviceImpl* This, STATEBLOCK* lpStateBlock);
|
2003-01-03 22:08:50 +01:00
|
|
|
|
2000-07-16 16:40:35 +02:00
|
|
|
/* This structure contains all the function pointers to OpenGL extensions
|
|
|
|
that are used by Wine */
|
|
|
|
typedef struct {
|
2003-01-08 00:08:31 +01:00
|
|
|
void (*ptr_ColorTableEXT) (GLenum target, GLenum internalformat,
|
|
|
|
GLsizei width, GLenum format, GLenum type, const GLvoid *table);
|
2000-07-16 16:40:35 +02:00
|
|
|
} Mesa_DeviceCapabilities;
|
|
|
|
|
2002-09-29 20:05:32 +02:00
|
|
|
#endif /* HAVE_OPENGL */
|
|
|
|
|
2000-04-09 16:30:50 +02:00
|
|
|
#endif /* __GRAPHICS_WINE_MESA_PRIVATE_H */
|