Browse Source

Add --disable-opengl flag.

This flag disables GL, GLES, but also Glew and EGL libraries.
legacy
Sam Hocevar 8 years ago
parent
commit
5b21579db4
11 changed files with 97 additions and 51 deletions
  1. +20
    -18
      build/autotools/m4/lol-conf.m4
  2. +2
    -1
      build/autotools/m4/lol-ffmpeg.m4
  3. +14
    -6
      build/autotools/m4/lol-gl.m4
  4. +9
    -10
      build/autotools/m4/lol-sdl.m4
  5. +3
    -1
      configure.ac
  6. +5
    -0
      src/gpu/framebuffer.cpp
  7. +13
    -6
      src/gpu/indexbuffer.cpp
  8. +6
    -1
      src/gpu/renderer.cpp
  9. +6
    -1
      src/gpu/shader.cpp
  10. +13
    -6
      src/gpu/texture.cpp
  11. +6
    -1
      src/gpu/vertexbuffer.cpp

+ 20
- 18
build/autotools/m4/lol-conf.m4 View File

@@ -1,7 +1,7 @@
dnl dnl
dnl Lol Engine dnl Lol Engine
dnl dnl
dnl Copyright © 2010—2016 Sam Hocevar <sam@hocevar.net>
dnl Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
dnl dnl
dnl Lol Engine is free software. It comes without any warranty, to dnl Lol Engine is free software. It comes without any warranty, to
dnl the extent permitted by applicable law. You can redistribute it dnl the extent permitted by applicable law. You can redistribute it
@@ -102,25 +102,27 @@ AC_CHECK_LIB(log, __android_log_vprint,
AM_CONDITIONAL(LOL_USE_ANDROID, test "${ac_cv_my_have_android}" != "no") AM_CONDITIONAL(LOL_USE_ANDROID, test "${ac_cv_my_have_android}" != "no")




dnl Use EGL?
dnl Use EGL? (autodetect unless GL is disabled)
ac_cv_my_have_egl="no" ac_cv_my_have_egl="no"
PKG_CHECK_MODULES(EGL, egl, [ac_cv_my_have_egl="yes"], [:])
if test "${ac_cv_my_have_egl}" != "no"; then
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="${EGL_LIBS} -lX11"
if test "${enable_gl}" != "no"; then
PKG_CHECK_MODULES(EGL, egl, [ac_cv_my_have_egl="yes"], [:])
if test "${ac_cv_my_have_egl}" != "no"; then
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="${EGL_LIBS} -lX11"
fi
AC_CHECK_LIB(EGL, main,
[ac_cv_my_have_egl="yes"
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="-lEGL"])
dnl Raspberry Pi is different, check for it with extra libs; also we
dnl look for a different function to bypass autoconf caching
AC_CHECK_LIB(EGL, eglGetDisplay,
[ac_cv_my_have_egl="yes"
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="-lEGL -lvcos -lvchiq_arm -lbcm_host -lGLESv2"],
[:],
[-lvcos -lvchiq_arm -lbcm_host -lGLESv2])
fi fi
AC_CHECK_LIB(EGL, main,
[ac_cv_my_have_egl="yes"
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="-lEGL"])
dnl Raspberry Pi is different, check for it with extra libs; also we
dnl look for a different function to bypass autoconf caching
AC_CHECK_LIB(EGL, eglGetDisplay,
[ac_cv_my_have_egl="yes"
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="-lEGL -lvcos -lvchiq_arm -lbcm_host -lGLESv2"],
[:],
[-lvcos -lvchiq_arm -lbcm_host -lGLESv2])
AM_CONDITIONAL(LOL_USE_EGL, test "${ac_cv_my_have_egl}" != "no") AM_CONDITIONAL(LOL_USE_EGL, test "${ac_cv_my_have_egl}" != "no")






+ 2
- 1
build/autotools/m4/lol-ffmpeg.m4 View File

@@ -1,7 +1,7 @@
dnl dnl
dnl Lol Engine dnl Lol Engine
dnl dnl
dnl Copyright © 2010—2016 Sam Hocevar <sam@hocevar.net>
dnl Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
dnl dnl
dnl Lol Engine is free software. It comes without any warranty, to dnl Lol Engine is free software. It comes without any warranty, to
dnl the extent permitted by applicable law. You can redistribute it dnl the extent permitted by applicable law. You can redistribute it
@@ -15,6 +15,7 @@ dnl
# --------------------- # ---------------------
AC_DEFUN([LOL_AC_CHECK_FFMPEG], AC_DEFUN([LOL_AC_CHECK_FFMPEG],
[ [
ac_cv_my_have_ffmpeg="no"
if test "${enable_ffmpeg}" != "no"; then if test "${enable_ffmpeg}" != "no"; then
LOL_AC_CHECK_FFMPEG_INNER() LOL_AC_CHECK_FFMPEG_INNER()
fi fi


+ 14
- 6
build/autotools/m4/lol-gl.m4 View File

@@ -1,7 +1,7 @@
dnl dnl
dnl Lol Engine dnl Lol Engine
dnl dnl
dnl Copyright © 2010—2016 Sam Hocevar <sam@hocevar.net>
dnl Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
dnl dnl
dnl Lol Engine is free software. It comes without any warranty, to dnl Lol Engine is free software. It comes without any warranty, to
dnl the extent permitted by applicable law. You can redistribute it dnl the extent permitted by applicable law. You can redistribute it
@@ -12,9 +12,20 @@ dnl




# LOL_AC_CHECK_OPENGL() # LOL_AC_CHECK_OPENGL()
# ------------------
# ---------------------
AC_DEFUN([LOL_AC_CHECK_OPENGL], AC_DEFUN([LOL_AC_CHECK_OPENGL],
[ [
ac_cv_my_have_glew="no"
if test "${enable_gl}" != "no"; then
LOL_AC_CHECK_OPENGL_INNER()
fi
AM_CONDITIONAL(LOL_USE_GLEW, test "${ac_cv_my_have_glew}" != "no")
])

# LOL_AC_CHECK_OPENGL_INNER()
# ---------------------------
AC_DEFUN([LOL_AC_CHECK_OPENGL_INNER],
[
dnl Find which version of OpenGL to use dnl Find which version of OpenGL to use
ac_cv_my_have_gl="no" ac_cv_my_have_gl="no"
ac_cv_my_stop_looking_for_gl="no" ac_cv_my_stop_looking_for_gl="no"
@@ -106,7 +117,6 @@ if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
fi fi


dnl Use Glew? dnl Use Glew?
ac_cv_my_have_glew="no"
PKG_CHECK_MODULES(GLEW, glew, PKG_CHECK_MODULES(GLEW, glew,
[ac_cv_my_have_glew="yes" [ac_cv_my_have_glew="yes"
GL_CFLAGS="${GLEW_CFLAGS} ${GL_CFLAGS}" GL_CFLAGS="${GLEW_CFLAGS} ${GL_CFLAGS}"
@@ -128,7 +138,6 @@ if test "${ac_cv_my_have_glew}" != "no"; then
AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available) AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available)
AC_DEFINE(LOL_USE_GLEW, 1, Define to 1 to use libglew) AC_DEFINE(LOL_USE_GLEW, 1, Define to 1 to use libglew)
fi fi
AM_CONDITIONAL(LOL_USE_GLEW, test "${ac_cv_my_have_glew}" != "no")


dnl Poor man's GL feature detection if all else failed. dnl Poor man's GL feature detection if all else failed.
save_LIBS="${LIBS}" save_LIBS="${LIBS}"
@@ -141,6 +150,5 @@ if test "${ac_cv_my_have_gl}" = "no"; then
AC_MSG_WARN([[No OpenGL or OpenGL ES implementation found]]) AC_MSG_WARN([[No OpenGL or OpenGL ES implementation found]])
fi fi


]) # LOL_AC_CHECK_OPENGL

]) # LOL_AC_CHECK_OPENGL_INNER



+ 9
- 10
build/autotools/m4/lol-sdl.m4 View File

@@ -1,7 +1,7 @@
dnl dnl
dnl Lol Engine dnl Lol Engine
dnl dnl
dnl Copyright © 2010—2016 Sam Hocevar <sam@hocevar.net>
dnl Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
dnl dnl
dnl Lol Engine is free software. It comes without any warranty, to dnl Lol Engine is free software. It comes without any warranty, to
dnl the extent permitted by applicable law. You can redistribute it dnl the extent permitted by applicable law. You can redistribute it
@@ -15,13 +15,17 @@ dnl
# ------------------ # ------------------
AC_DEFUN([LOL_AC_CHECK_SDL], AC_DEFUN([LOL_AC_CHECK_SDL],
[ [
ac_cv_my_have_sdl="no"
ac_cv_my_have_old_sdl="no"
ac_cv_my_have_sdl_image="no"
ac_cv_my_have_sdl_mixer="no"
if test "${enable_sdl}" != "no"; then if test "${enable_sdl}" != "no"; then
LOL_AC_CHECK_SDL_INNER() LOL_AC_CHECK_SDL_INNER()
fi fi
AM_CONDITIONAL(LOL_USE_SDL, test "x${ac_cv_my_have_sdl}" = xyes)
AM_CONDITIONAL(LOL_USE_SDL_MIXER, test "x${ac_cv_my_have_sdl_mixer}" = xyes)
AM_CONDITIONAL(LOL_USE_SDL_IMAGE, test "x${ac_cv_my_have_sdl_image}" = xyes)
AM_CONDITIONAL(LOL_USE_OLD_SDL, test "x${ac_cv_my_have_old_sdl}" = xyes)
AM_CONDITIONAL(LOL_USE_SDL, test "${ac_cv_my_have_sdl}" != "no")
AM_CONDITIONAL(LOL_USE_SDL_MIXER, test "${ac_cv_my_have_sdl_mixer}" != "no")
AM_CONDITIONAL(LOL_USE_SDL_IMAGE, test "${ac_cv_my_have_sdl_image}" != "no")
AM_CONDITIONAL(LOL_USE_OLD_SDL, test "${ac_cv_my_have_old_sdl}" != "no")
]) ])


# LOL_AC_CHECK_SDL_INNER() # LOL_AC_CHECK_SDL_INNER()
@@ -47,11 +51,6 @@ dnl Generated shell variables:
dnl SDL_CFLAGS -- flags for SDL compilation dnl SDL_CFLAGS -- flags for SDL compilation
dnl SDL_LIBS -- flags for SDL linking dnl SDL_LIBS -- flags for SDL linking


ac_cv_my_have_sdl="no"
ac_cv_my_have_old_sdl="no"
ac_cv_my_have_sdl_image="no"
ac_cv_my_have_sdl_mixer="no"



dnl First, try the proper pkg-config check for SDL2 dnl First, try the proper pkg-config check for SDL2




+ 3
- 1
configure.ac View File

@@ -1,7 +1,7 @@
dnl dnl
dnl Lol Engine dnl Lol Engine
dnl dnl
dnl Copyright © 2010—2016 Sam Hocevar <sam@hocevar.net>
dnl Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
dnl dnl
dnl Lol Engine is free software. It comes without any warranty, to dnl Lol Engine is free software. It comes without any warranty, to
dnl the extent permitted by applicable law. You can redistribute it dnl the extent permitted by applicable law. You can redistribute it
@@ -80,6 +80,8 @@ AC_ARG_ENABLE(experimental,
AC_ARG_ENABLE(subproject, AC_ARG_ENABLE(subproject,
[ --enable-subproject build as a subproject (default no)]) [ --enable-subproject build as a subproject (default no)])


AC_ARG_ENABLE(gl,
[ --enable-gl build using OpenGL or OpenGL ES (default autodetected)])
AC_ARG_ENABLE(ffmpeg, AC_ARG_ENABLE(ffmpeg,
[ --enable-ffmpeg build using FFmpeg (default autodetected)]) [ --enable-ffmpeg build using FFmpeg (default autodetected)])
AC_ARG_ENABLE(sdl, AC_ARG_ENABLE(sdl,


+ 5
- 0
src/gpu/framebuffer.cpp View File

@@ -12,6 +12,9 @@


#include <lol/engine-internal.h> #include <lol/engine-internal.h>


// FIXME: fine-tune this define
#if defined LOL_USE_GLEW || defined HAVE_GL_2X || defined HAVE_GLES_2X

#include "lolgl.h" #include "lolgl.h"


namespace lol namespace lol
@@ -391,3 +394,5 @@ void Framebuffer::Unbind()


} /* namespace lol */ } /* namespace lol */


#endif


+ 13
- 6
src/gpu/indexbuffer.cpp View File

@@ -1,15 +1,20 @@
// //
// Lol Engine
// Lol Engine
// //
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
// Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
// //


#include <lol/engine-internal.h> #include <lol/engine-internal.h>


// FIXME: fine-tune this define
#if defined LOL_USE_GLEW || defined HAVE_GL_2X || defined HAVE_GLES_2X

#include "lolgl.h" #include "lolgl.h"


namespace lol namespace lol
@@ -99,3 +104,5 @@ void IndexBuffer::Unbind()


} /* namespace lol */ } /* namespace lol */


#endif


+ 6
- 1
src/gpu/renderer.cpp View File

@@ -1,7 +1,7 @@
// //
// Lol Engine // Lol Engine
// //
// Copyright © 2010—2016 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
// //
// Lol Engine is free software. It comes without any warranty, to // Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it // the extent permitted by applicable law. You can redistribute it
@@ -22,6 +22,9 @@
# undef far /* Fuck Microsoft again */ # undef far /* Fuck Microsoft again */
#endif #endif


// FIXME: fine-tune this define
#if defined LOL_USE_GLEW || defined HAVE_GL_2X || defined HAVE_GLES_2X

#include "lolgl.h" #include "lolgl.h"


namespace lol namespace lol
@@ -592,3 +595,5 @@ vec4 Renderer::GetScissorRect() const


} /* namespace lol */ } /* namespace lol */


#endif


+ 6
- 1
src/gpu/shader.cpp View File

@@ -1,7 +1,7 @@
// //
// Lol Engine // Lol Engine
// //
// Copyright © 2010—2015 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
// //
// Lol Engine is free software. It comes without any warranty, to // Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it // the extent permitted by applicable law. You can redistribute it
@@ -25,6 +25,9 @@


#include "lolgl.h" #include "lolgl.h"


// FIXME: fine-tune this define
#if defined LOL_USE_GLEW || defined HAVE_GL_2X || defined HAVE_GLES_2X

namespace lol namespace lol
{ {


@@ -1066,3 +1069,5 @@ void ShaderBuilder::Build(String& code)


} /* namespace lol */ } /* namespace lol */


#endif


+ 13
- 6
src/gpu/texture.cpp View File

@@ -1,17 +1,22 @@
// //
// Lol Engine
// Lol Engine
// //
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
// Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
// //


#include <lol/engine-internal.h> #include <lol/engine-internal.h>


#include "lolgl.h" #include "lolgl.h"


// FIXME: fine-tune this define
#if defined LOL_USE_GLEW || defined HAVE_GL_2X || defined HAVE_GLES_2X

namespace lol namespace lol
{ {


@@ -176,3 +181,5 @@ Texture::~Texture()


} /* namespace lol */ } /* namespace lol */


#endif


+ 6
- 1
src/gpu/vertexbuffer.cpp View File

@@ -1,7 +1,7 @@
// //
// Lol Engine // Lol Engine
// //
// Copyright © 2010—2016 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
// //
// Lol Engine is free software. It comes without any warranty, to // Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it // the extent permitted by applicable law. You can redistribute it
@@ -14,6 +14,9 @@


#include "lolgl.h" #include "lolgl.h"


// FIXME: fine-tune this define
#if defined LOL_USE_GLEW || defined HAVE_GL_2X || defined HAVE_GLES_2X

namespace lol namespace lol
{ {


@@ -389,3 +392,5 @@ void VertexBuffer::Unlock()


} /* namespace lol */ } /* namespace lol */


#endif


Loading…
Cancel
Save