Changeset 723


Ignore:
Timestamp:
Mar 6, 2011, 4:04:48 PM (10 years ago)
Author:
sam
Message:

core: fix a few compilation errors and warnings on OS X.

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/image.cpp

    r714 r723  
    2525
    2626#include "core.h"
    27 #include "lolgl.h"
    2827
    2928namespace lol
  • trunk/src/input.cpp

    r686 r723  
    6161vec2 Input::GetAxis(int axis)
    6262{
    63     float invsqrt2 = sqrtf(0.5f);
    6463    vec2 ret;
    6564
     
    7271    ret.y += up;
    7372    if (left && up)
    74         ret = ret * invsqrt2;
     73        ret = ret * sqrtf(0.5f);
    7574#else
    7675    ret = 0;
  • trunk/src/lolgl.h

    r697 r723  
    4242#   endif
    4343#elif defined HAVE_GLES_1X
    44 #   include <GLES/gl.h>
    45 #   include <GLES/glext.h>
     44#   if defined __APPLE__ && defined __MACH__
     45#       include <OpenGLES/ES1/gl.h>
     46#       include <OpenGLES/ES1/glext.h>
     47#   else
     48#       include <GLES/gl.h>
     49#       include <GLES/glext.h>
     50#   endif
    4651#elif defined HAVE_GLES_2X
    47 #   include <GLES2/gl2.h>
    48 #   include <GLES2/gl2ext.h>
     52#   if defined __APPLE__ && defined __MACH__
     53#       include <OpenGLES/ES2/gl.h>
     54#       include <OpenGLES/ES2/glext.h>
     55#   else
     56#       include <GLES2/gl2.h>
     57#       include <GLES2/gl2ext.h>
     58#   endif
    4959#endif
    5060
  • trunk/src/sample.cpp

    r686 r723  
    1616#include <cstdio>
    1717#include <cmath>
     18#include <cstring>
    1819
    1920#if defined USE_SDL
  • trunk/src/timer.cpp

    r686 r723  
    1717#include <stdint.h>
    1818
    19 #if defined __linux__
     19#if defined __linux__ || defined __APPLE__
    2020#   include <sys/time.h>
    2121#   include <unistd.h>
     
    4343    TimerData()
    4444    {
    45 #if defined __linux__
     45#if defined __linux__ || defined __APPLE__
    4646        gettimeofday(&tv0, NULL);
    4747#elif defined _WIN32
     
    5959    {
    6060        float ret, towait;
    61 #if defined __linux__
     61#if defined __linux__ || defined __APPLE__
    6262        struct timeval tv;
    6363        gettimeofday(&tv, NULL);
     
    9191    }
    9292
    93 #if defined __linux__
     93#if defined __linux__ || defined __APPLE__
    9494    struct timeval tv0;
    9595#elif defined _WIN32
Note: See TracChangeset for help on using the changeset viewer.