mirror of
https://github.com/love2d/love-android.git
synced 2026-08-18 19:54:18 +02:00
first working build
This commit is contained in:
@@ -135,8 +135,6 @@ void Graphics::setViewportSize(int width, int height)
|
||||
|
||||
bool Graphics::setMode(int width, int height)
|
||||
{
|
||||
SDL_Log ("Graphics::setMode %d,%d", width, height);
|
||||
|
||||
this->width = width;
|
||||
this->height = height;
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
// C
|
||||
#include <cstring>
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace graphics
|
||||
@@ -54,10 +52,8 @@ bool OpenGL::initContext()
|
||||
if (contextInitialized)
|
||||
return true;
|
||||
|
||||
if (!gladLoadGL()) {
|
||||
SDL_Log ("Initialization of OpenGL failed! Aborting!");
|
||||
abort();
|
||||
}
|
||||
if (!gladLoadGL())
|
||||
return false;
|
||||
|
||||
initOpenGLFunctions();
|
||||
initVendor();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "Decoder.h"
|
||||
|
||||
// SDL_sound
|
||||
#include <modplug.h>
|
||||
#include <libmodplug/modplug.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
#include "libraries/glad/gladfuncs.hpp"
|
||||
using namespace glad;
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace window
|
||||
@@ -98,27 +95,6 @@ bool Window::setWindow(int width, int height, WindowAttributes *attribs)
|
||||
|
||||
Uint32 sdlflags = SDL_WINDOW_OPENGL;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
f.fullscreen = true;
|
||||
f.resizable = false;
|
||||
|
||||
if (window) {
|
||||
int query_width, query_height;
|
||||
SDL_GetWindowSize (window, &query_width, &query_height);
|
||||
SDL_Log ("Overriding windows size to = %d,%d", query_width, query_height);
|
||||
|
||||
width = query_width;
|
||||
height = query_height;
|
||||
} else {
|
||||
SDL_DisplayMode mode = {};
|
||||
|
||||
SDL_GetDesktopDisplayMode(f.display, &mode);
|
||||
SDL_Log ("Overriding windows size to = %d,%d", mode.w, mode.h);
|
||||
|
||||
width = mode.w;
|
||||
height = mode.h;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (f.fullscreen)
|
||||
{
|
||||
@@ -130,10 +106,8 @@ bool Window::setWindow(int width, int height, WindowAttributes *attribs)
|
||||
|
||||
// Fullscreen window creation will bug out if no mode can be used.
|
||||
SDL_DisplayMode mode = {0, width, height, 0, 0};
|
||||
if (SDL_GetClosestDisplayMode(f.display, &mode, &mode) == 0) {
|
||||
displayError ("SDL", "Could not get closest display mode");
|
||||
if (SDL_GetClosestDisplayMode(f.display, &mode, &mode) == 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user