Commit 2cc43393 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: The adapters array should be owned by IWineD3DImpl.

parent 3644a7f6
......@@ -1911,6 +1911,7 @@ typedef void (WINE_GLAPI * PGLFNRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLenum ta
typedef void (WINE_GLAPI * PGLFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
typedef void (WINE_GLAPI * PGLFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
typedef void (WINE_GLAPI * PGLFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
typedef void (WINE_GLAPI * PGLFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
typedef void (WINE_GLAPI * PGLFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
/* GL_EXT_paletted_texture */
#ifndef GL_EXT_paletted_texture
......@@ -3578,6 +3579,7 @@ typedef enum _GL_SupportedExt {
USE_GL_FUNC(PGLFNGLPOINTPARAMETERFVEXTPROC, glPointParameterfvEXT, EXT_POINT_PARAMETERS, NULL )\
/* GL_EXT_secondary_color */ \
USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3UBEXTPROC, glSecondaryColor3ubEXT, EXT_SECONDARY_COLOR, NULL )\
USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3UBVEXTPROC, glSecondaryColor3ubvEXT, EXT_SECONDARY_COLOR, NULL )\
USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3FEXTPROC, glSecondaryColor3fEXT, EXT_SECONDARY_COLOR, NULL )\
USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3FVEXTPROC, glSecondaryColor3fvEXT, EXT_SECONDARY_COLOR, NULL )\
USE_GL_FUNC(PGLFNGLSECONDARYCOLORPOINTEREXTPROC, glSecondaryColorPointerEXT, EXT_SECONDARY_COLOR, NULL )\
......
......@@ -53,20 +53,23 @@ wined3d_settings_t wined3d_settings =
IWineD3D* WINAPI WineDirect3DCreate(UINT dxVersion, IUnknown *parent) {
IWineD3DImpl* object;
if (!InitAdapters()) {
WARN("Failed to initialize direct3d adapters, Direct3D will not be available\n");
if(dxVersion > 7) {
ERR("Direct3D%d is not available without opengl\n", dxVersion);
return NULL;
}
}
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IWineD3DImpl));
object->lpVtbl = &IWineD3D_Vtbl;
object->dxVersion = dxVersion;
object->ref = 1;
object->parent = parent;
if (!InitAdapters(object))
{
WARN("Failed to initialize direct3d adapters, Direct3D will not be available\n");
if (dxVersion > 7)
{
ERR("Direct3D%d is not available without opengl\n", dxVersion);
HeapFree(GetProcessHeap(), 0, object);
return NULL;
}
}
TRACE("Created WineD3D object @ %p for d3d%d support\n", object, dxVersion);
return (IWineD3D *)object;
......
......@@ -670,6 +670,7 @@ typedef void (WINE_GLAPI *glAttribFunc)(const void *data);
typedef void (WINE_GLAPI *glMultiTexCoordFunc)(GLenum unit, const void *data);
extern glAttribFunc position_funcs[WINED3DDECLTYPE_UNUSED];
extern glAttribFunc diffuse_funcs[WINED3DDECLTYPE_UNUSED];
extern glAttribFunc specular_func_3ubv;
extern glAttribFunc specular_funcs[WINED3DDECLTYPE_UNUSED];
extern glAttribFunc normal_funcs[WINED3DDECLTYPE_UNUSED];
extern glMultiTexCoordFunc multi_texcoord_funcs[WINED3DDECLTYPE_UNUSED];
......@@ -937,7 +938,6 @@ struct WineD3DAdapter
unsigned int UsedTextureRam;
};
extern BOOL InitAdapters(void);
extern BOOL initPixelFormats(WineD3D_GL_Info *gl_info);
extern long WineD3DAdapterChangeGLRam(IWineD3DDeviceImpl *D3DDevice, long glram);
extern void add_gl_compat_wrappers(WineD3D_GL_Info *gl_info);
......@@ -1025,10 +1025,15 @@ typedef struct IWineD3DImpl
/* WineD3D Information */
IUnknown *parent;
UINT dxVersion;
UINT adapter_count;
struct WineD3DAdapter adapters[1];
} IWineD3DImpl;
extern const IWineD3DVtbl IWineD3D_Vtbl;
BOOL InitAdapters(IWineD3DImpl *This);
/* TODO: setup some flags in the registry to enable, disable pbuffer support
(since it will break quite a few things until contexts are managed properly!) */
extern BOOL pbuffer_support;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment