Changeset 1212


Ignore:
Timestamp:
Apr 10, 2012, 8:39:12 PM (8 years ago)
Author:
sam
Message:

build: allow to build the Direct3D 9 driver with the mingw compiler.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r1173 r1212  
    110110 [MAKE_FSELF=no])
    111111AM_CONDITIONAL(USE_MAKE_FSELF, test "${MAKE_FSELF}" != "no")
     112
     113
     114dnl Are we on a Direct3D 9 platform?
     115ac_cv_my_have_d3d9="no"
     116AC_CHECK_HEADERS(d3d9.h, [ac_cv_my_have_d3d9="yes"])
     117if test "${ac_cv_my_have_d3d9}" != "no"; then
     118  D3D_LIBS="${D3D_LIBS} -ld3d9 -ld3dx9"
     119  AC_DEFINE(USE_D3D9, 1, Define to 1 to use DirectX 9)
     120fi
     121AM_CONDITIONAL(USE_D3D9, test "${ac_cv_my_have_d3d9}" != "no")
    112122
    113123
     
    332342LOL_CFLAGS="$LOL_CFLAGS -I \$(top_srcdir)/src"
    333343LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $GL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS"
    334 LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS"
     344LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS $D3D_LIBS"
    335345
    336346AC_SUBST(MATH_LIBS)
  • trunk/src/gpu/shader.cpp

    r1208 r1212  
    2121#   include <windows.h>
    2222#   if defined USE_D3D9
     23#       include <algorithm>
     24        using std::min;
     25        using std::max;
    2326#       include <d3d9.h>
    2427#       include <d3dx9shader.h>
  • trunk/src/platform/sdl/sdlapp.cpp

    r1208 r1212  
    2626#include "platform/sdl/sdlinput.h"
    2727
    28 #if defined USE_D3D9
     28#if defined USE_SDL && defined USE_D3D9
    2929HWND g_hwnd = NULL;
     30extern IDirect3DDevice9 *g_d3ddevice;
    3031#endif
    3132
     
    102103    {
    103104#if defined USE_SDL && defined USE_D3D9
    104         extern IDirect3DDevice9 *g_d3ddevice;
    105105        g_d3ddevice->BeginScene();
    106106#endif
  • trunk/src/platform/xbox/xboxapp.cpp

    r1194 r1212  
    2020#include "lolgl.h"
    2121#include "xboxapp.h"
     22
     23#if defined _XBOX
     24extern D3DDevice *g_d3ddevice;
     25#endif
    2226
    2327namespace lol
     
    6367
    6468#if defined _XBOX
    65         extern D3DDevice *g_d3ddevice;
    6669        g_d3ddevice->Present(NULL, NULL, NULL, NULL);
    6770#endif
  • trunk/src/scene.cpp

    r1208 r1212  
    6262
    6363#if defined USE_D3D9 || defined _XBOX
    64 #   define STR0(x) #x
    65 #   define STR(x) STR0(x)
    66 #   pragma message(__FILE__ "(" STR(__LINE__) "): warning: Scene not implemented")
    67 #   undef STR
    68 #   undef STR0
     64#   if defined __GNUC__
     65#       warning Scene not implemented
     66#   else
     67#      define STR0(x) #x
     68#      define STR(x) STR0(x)
     69#      pragma message(__FILE__ "(" STR(__LINE__) "): warning: Scene not implemented")
     70#      undef STR
     71#      undef STR0
     72#   endif
    6973#else
    7074#if defined HAVE_GL_2X && !defined __APPLE__
     
    9296
    9397#if defined USE_D3D9 || defined _XBOX
    94 #   define STR0(x) #x
    95 #   define STR(x) STR0(x)
    96 #   pragma message(__FILE__ "(" STR(__LINE__) "): warning: Scene::Scene() not implemented")
    97 #   undef STR
    98 #   undef STR0
     98    /* TODO */
    9999#else
    100100    data->bufs = 0;
    101101    data->nbufs = 0;
    102 #endif
    103 
    104 #if defined HAVE_GL_2X && !defined __APPLE__
     102
     103#   if defined HAVE_GL_2X && !defined __APPLE__
    105104    glGenVertexArrays(1, &data->vao);
     105#   endif
    106106#endif
    107107}
     
    110110{
    111111#if defined USE_D3D9 || defined _XBOX
    112 #   define STR0(x) #x
    113 #   define STR(x) STR0(x)
    114 #   pragma message(__FILE__ "(" STR(__LINE__) "): warning: Scene::~Scene() not implemented")
    115 #   undef STR
    116 #   undef STR0
     112    /* TODO */
    117113#else
    118114    /* FIXME: this must be done while the GL context is still active.
     
    345341
    346342#if defined USE_D3D9 || defined _XBOX
    347 #   define STR0(x) #x
    348 #   define STR(x) STR0(x)
    349 #   pragma message(__FILE__ "(" STR(__LINE__) "): warning: Scene::Render() not implemented")
    350 #   undef STR
    351 #   undef STR0
     343    /* TODO */
    352344#elif !defined __CELLOS_LV2__
    353345    uni_tex = stdshader->GetUniformLocation("in_Texture");
     
    360352
    361353#if defined USE_D3D9 || defined _XBOX
    362 #   define STR0(x) #x
    363 #   define STR(x) STR0(x)
    364 #   pragma message(__FILE__ "(" STR(__LINE__) "): warning: Scene::Render() not implemented")
    365 #   undef STR
    366 #   undef STR0
     354    /* TODO */
    367355#else
    368356#if !defined HAVE_GLES_2X
     
    382370    {
    383371#if defined USE_D3D9 || defined _XBOX
    384 #   define STR0(x) #x
    385 #   define STR(x) STR0(x)
    386 #   pragma message(__FILE__ "(" STR(__LINE__) "): warning: Scene::Render() not implemented")
    387 #   undef STR
    388 #   undef STR0
     372    /* TODO */
    389373#else
    390374        /* Generate new vertex / texture coord buffers if necessary */
     
    424408#endif
    425409#if defined USE_D3D9 || defined _XBOX
    426 #   define STR0(x) #x
    427 #   define STR(x) STR0(x)
    428 #   pragma message(__FILE__ "(" STR(__LINE__) "): warning: Scene::Render() not implemented")
    429 #   undef STR
    430 #   undef STR0
     410    /* TODO */
    431411#else
    432412#if !defined __CELLOS_LV2__ // Use cgGLEnableClientState etc.
     
    475455
    476456#if defined USE_D3D9 || defined _XBOX
    477 #   define STR0(x) #x
    478 #   define STR(x) STR0(x)
    479 #   pragma message(__FILE__ "(" STR(__LINE__) "): warning: Scene::Render() not implemented")
    480 #   undef STR
    481 #   undef STR0
     457    /* TODO */
    482458#else
    483459#if !defined HAVE_GLES_2X
Note: See TracChangeset for help on using the changeset viewer.