src/video/android/SDL_androidgl.c
author Sam Lantinga <slouken@libsdl.org>
Fri, 11 Feb 2011 22:37:15 -0800
changeset 5262 b530ef003506
parent 5222 c66b2a778b7e
child 5535 96594ac5fd1a
permissions -rw-r--r--
Happy 2011! :)
paul@4701
     1
/*
paul@4701
     2
    SDL - Simple DirectMedia Layer
slouken@5262
     3
    Copyright (C) 1997-2011 Sam Lantinga
paul@4701
     4
paul@4701
     5
    This library is free software; you can redistribute it and/or
paul@4701
     6
    modify it under the terms of the GNU Lesser General Public
paul@4701
     7
    License as published by the Free Software Foundation; either
paul@4701
     8
    version 2.1 of the License, or (at your option) any later version.
paul@4701
     9
paul@4701
    10
    This library is distributed in the hope that it will be useful,
paul@4701
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
paul@4701
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
paul@4701
    13
    Lesser General Public License for more details.
paul@4701
    14
paul@4701
    15
    You should have received a copy of the GNU Lesser General Public
paul@4701
    16
    License along with this library; if not, write to the Free Software
paul@4701
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
paul@4701
    18
paul@4701
    19
    Sam Lantinga
paul@4701
    20
    slouken@libsdl.org
paul@4701
    21
*/
paul@4701
    22
#include "SDL_config.h"
paul@4701
    23
slouken@4980
    24
/* Android SDL video driver implementation */
paul@4701
    25
paul@4701
    26
#include "SDL_video.h"
paul@4701
    27
paul@4701
    28
#include "SDL_androidvideo.h"
slouken@5090
    29
#include "../../core/android/SDL_android.h"
paul@4701
    30
paul@4707
    31
#include <android/log.h>
paul@4701
    32
paul@4701
    33
paul@4701
    34
/* GL functions */
slouken@4989
    35
int
slouken@4989
    36
Android_GL_LoadLibrary(_THIS, const char *path)
slouken@4989
    37
{
slouken@4989
    38
    __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n");
slouken@4989
    39
    return 0;
paul@4701
    40
}
paul@4701
    41
slouken@4989
    42
void *
slouken@4989
    43
Android_GL_GetProcAddress(_THIS, const char *proc)
slouken@4989
    44
{
slouken@4989
    45
    __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetProcAddress\n");
slouken@4989
    46
    return 0;
paul@4701
    47
}
paul@4701
    48
slouken@4989
    49
void
slouken@4989
    50
Android_GL_UnloadLibrary(_THIS)
slouken@4989
    51
{
slouken@4989
    52
    __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_UnloadLibrary\n");
paul@4701
    53
}
paul@4701
    54
slouken@4989
    55
SDL_GLContext
slouken@4989
    56
Android_GL_CreateContext(_THIS, SDL_Window * window)
slouken@4989
    57
{
slouken@5222
    58
    if (!Android_JNI_CreateContext(_this->gl_config.major_version,
slouken@5222
    59
                                   _this->gl_config.minor_version)) {
slouken@5222
    60
        SDL_SetError("Couldn't create OpenGL context - see Android log for details");
slouken@5222
    61
        return NULL;
slouken@5222
    62
    }
slouken@5204
    63
    return (SDL_GLContext)1;
paul@4701
    64
}
paul@4701
    65
slouken@4989
    66
int
slouken@4989
    67
Android_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
slouken@4989
    68
{
slouken@4989
    69
    /* There's only one context, nothing to do... */
slouken@4989
    70
    return 0;
paul@4701
    71
}
paul@4701
    72
slouken@4989
    73
int
slouken@4989
    74
Android_GL_SetSwapInterval(_THIS, int interval)
slouken@4989
    75
{
slouken@4989
    76
    __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SetSwapInterval\n");
slouken@4989
    77
    return 0;
paul@4701
    78
}
paul@4701
    79
slouken@4989
    80
int
slouken@4989
    81
Android_GL_GetSwapInterval(_THIS)
slouken@4989
    82
{
slouken@4989
    83
    __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetSwapInterval\n");
slouken@4989
    84
    return 0;
paul@4701
    85
}
paul@4701
    86
slouken@4989
    87
void
slouken@4989
    88
Android_GL_SwapWindow(_THIS, SDL_Window * window)
slouken@4989
    89
{
slouken@4989
    90
    Android_JNI_SwapWindow();
paul@4701
    91
}
paul@4701
    92
slouken@4989
    93
void
slouken@4989
    94
Android_GL_DeleteContext(_THIS, SDL_GLContext context)
slouken@4989
    95
{
slouken@4989
    96
    __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n");
paul@4701
    97
}
slouken@5222
    98
slouken@5222
    99
/* vi: set ts=4 sw=4 expandtab: */