Ignore:
Timestamp:
Jun 23, 2013, 12:18:31 PM (9 years ago)
Author:
sam
Message:

gpu: get rid of the global D3D device pointer and move D3D initialisation
code from the Video to the Renderer class.

Location:
trunk/src/platform
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/platform/sdl/sdlapp.cpp

    r2644 r2770  
    3535#if defined USE_SDL && defined USE_D3D9
    3636HWND g_hwnd = nullptr;
    37 extern IDirect3DDevice9 *g_d3ddevice;
    3837#endif
    3938
     
    116115{
    117116#if defined USE_SDL && defined USE_D3D9
     117    IDirect3DDevice9 *d3d_dev = (IDirect3DDevice9 *)g_renderer->GetDevice();
    118118    HRESULT hr;
    119     hr = g_d3ddevice->BeginScene();
     119    hr = d3d_dev->BeginScene();
    120120    if (FAILED(hr))
    121121        Abort();
    122122#endif
     123
    123124    /* Tick the renderer, show the frame and clamp to desired framerate. */
    124125    Ticker::TickDraw();
    125 #if defined USE_SDL
    126 #   if defined USE_D3D9
    127     hr = g_d3ddevice->EndScene();
     126
     127#if defined USE_SDL && defined USE_D3D9
     128    hr = d3d_dev->EndScene();
    128129    if (FAILED(hr))
    129130        Abort();
    130     hr = g_d3ddevice->Present(nullptr, nullptr, nullptr, nullptr);
     131    hr = d3d_dev->Present(nullptr, nullptr, nullptr, nullptr);
    131132    if (FAILED(hr))
    132133        Abort();
    133 #   else
     134#elif defined USE_SDL
    134135    SDL_GL_SwapBuffers();
    135 #   endif
    136136#endif
    137137}
  • trunk/src/platform/xbox/xboxapp.cpp

    r2506 r2770  
    2020#include "xboxapp.h"
    2121#include "xboxinput.h"
    22 
    23 #if defined _XBOX
    24 extern D3DDevice *g_d3ddevice;
    25 #endif
    2622
    2723namespace lol
     
    6864
    6965#if defined _XBOX
    70     g_d3ddevice->Present(nullptr, nullptr, nullptr, nullptr);
     66    D3DDevice9 *d3d_dev = (D3DDevice9 *)g_renderer->GetDevice();
     67    d3d_dev->Present(nullptr, nullptr, nullptr, nullptr);
    7168#endif
    7269}
Note: See TracChangeset for help on using the changeset viewer.