comparison src/video/win32/SDL_d3drender.c @ 1925:411bfb37082b

Query the maximum texture size for the D3D renderer.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 22 Jul 2006 21:17:37 +0000
parents 69217fdd2c0a
children a788656ca29a
comparison
equal deleted inserted replaced
1924:69217fdd2c0a 1925:411bfb37082b
236 SDL_Renderer *renderer; 236 SDL_Renderer *renderer;
237 D3D_RenderData *data; 237 D3D_RenderData *data;
238 HRESULT result; 238 HRESULT result;
239 D3DPRESENT_PARAMETERS pparams; 239 D3DPRESENT_PARAMETERS pparams;
240 IDirect3DSwapChain9 *chain; 240 IDirect3DSwapChain9 *chain;
241 D3DCAPS9 caps;
241 242
242 renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); 243 renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
243 if (!renderer) { 244 if (!renderer) {
244 SDL_OutOfMemory(); 245 SDL_OutOfMemory();
245 return NULL; 246 return NULL;
353 } 354 }
354 if (pparams.PresentationInterval == D3DPRESENT_INTERVAL_ONE) { 355 if (pparams.PresentationInterval == D3DPRESENT_INTERVAL_ONE) {
355 renderer->info.flags |= SDL_Renderer_PresentVSync; 356 renderer->info.flags |= SDL_Renderer_PresentVSync;
356 } 357 }
357 358
358 /* FIXME: Query maximum texture size */ 359 IDirect3DDevice9_GetDeviceCaps(data->device, &caps);
360 renderer->info.max_texture_width = caps.MaxTextureWidth;
361 renderer->info.max_texture_height = caps.MaxTextureHeight;
359 362
360 /* Set up parameters for rendering */ 363 /* Set up parameters for rendering */
361 IDirect3DDevice9_SetVertexShader(data->device, NULL); 364 IDirect3DDevice9_SetVertexShader(data->device, NULL);
362 IDirect3DDevice9_SetFVF(data->device, D3DFVF_XYZRHW | D3DFVF_TEX1); 365 IDirect3DDevice9_SetFVF(data->device, D3DFVF_XYZRHW | D3DFVF_TEX1);
363 IDirect3DDevice9_SetRenderState(data->device, D3DRS_CULLMODE, 366 IDirect3DDevice9_SetRenderState(data->device, D3DRS_CULLMODE,