$(error Empty EIGEN_CXXFLAGS. You probably need to install Eigen3)
endif
+GLEW_CXXFLAGS := $(shell pkg-config --cflags glew)
+ifeq ($(GLEW_CXXFLAGS),)
+$(error Empty GLEW_CXXFLAGS. You probably need to install GLEW)
+endif
+
+GLEW_LIBS := $(shell pkg-config --libs glew)
+ifeq ($(GLEW_LIBS),)
+$(error Empty GLEW_LIBS. You probably need to install GLEW)
+endif
+
CC=gcc
CXX=g++
-CXXFLAGS=-Wall -g -I$(GTEST_DIR)/include $(EIGEN_CXXFLAGS)
-LDFLAGS=-lSDL -lSDL_image -lGL -lrt -lpthread
+CXXFLAGS=-Wall -g -I$(GTEST_DIR)/include $(EIGEN_CXXFLAGS) $(GLEW_CXXFLAGS)
+LDFLAGS=-lSDL -lSDL_image -lGL -lrt -lpthread $(GLEW_LIBS)
RANLIB=ranlib
ifeq ($(COVERAGE),1)
#include <math.h>
#include <assert.h>
+#include <GL/glew.h>
#include "blur_effect.h"
#include "effect_chain.h"
#include "util.h"
-#include "opengl.h"
// Must match blur_effect.frag.
#define NUM_TAPS 16
#include <math.h>
#include <assert.h>
+#include <GL/glew.h>
#include <Eigen/Dense>
#include <Eigen/Cholesky>
#include "deconvolution_sharpen_effect.h"
#include "util.h"
-#include "opengl.h"
using namespace Eigen;
#include <vector>
#include <map>
+#include <GL/glew.h>
+
#include <SDL/SDL.h>
#include <SDL/SDL_opengl.h>
#include <SDL/SDL_image.h>
#include "effect.h"
#include "effect_chain.h"
#include "util.h"
-#include "opengl.h"
#include "widgets.h"
#include "flat_input.h"
#include <math.h>
#include <assert.h>
+#include <GL/glew.h>
#include "dither_effect.h"
#include "util.h"
-#include "opengl.h"
namespace {
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#include <GL/glew.h>
+
#include "effect.h"
#include "effect_chain.h"
#include "util.h"
-#include "opengl.h"
-
GLint get_uniform_location(GLuint glsl_program_num, const std::string &prefix, const std::string &key)
{
std::string name = prefix + "_" + key;
#include <Eigen/Core>
-#include "opengl.h"
+#include <GL/glew.h>
#include "util.h"
class EffectChain;
#include <math.h>
#include <string.h>
#include <assert.h>
+#include <GL/glew.h>
#include <algorithm>
#include <set>
#include "colorspace_conversion_effect.h"
#include "dither_effect.h"
#include "input.h"
-#include "opengl.h"
EffectChain::EffectChain(float aspect_nom, float aspect_denom)
: aspect_nom(aspect_nom),
//
// Note that this also contains the tests for some of the simpler effects.
+#include <GL/glew.h>
+
#include "effect_chain.h"
#include "flat_input.h"
#include "gtest/gtest.h"
#include "mirror_effect.h"
#include "resize_effect.h"
-#include "opengl.h"
#include "test_util.h"
TEST(EffectChainTest, EmptyChain) {
#include <string.h>
#include <assert.h>
+#include <GL/glew.h>
#include "flat_input.h"
#include "util.h"
-#include "opengl.h"
FlatInput::FlatInput(ImageFormat image_format, MovitPixelFormat pixel_format, GLenum type, unsigned width, unsigned height)
: image_format(image_format),
+#include <GL/glew.h>
+
#include "init.h"
-#include "opengl.h"
#include "util.h"
-#include <set>
-#include <string>
-
bool movit_initialized = false;
float movit_texel_subpixel_precision;
bool movit_srgb_textures_supported;
check_error();
}
-void get_extensions(std::set<std::string> *extensions)
-{
- char *str = strdup(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));
- for (char *ptr = strtok(str, " "); ptr != NULL; ptr = strtok(NULL, " ")) {
- extensions->insert(ptr);
- }
- free(str);
-}
-
void check_extensions()
{
- std::set<std::string> extensions;
- get_extensions(&extensions);
-
// We fundamentally need FBOs and floating-point textures.
- assert(extensions.count("GL_ARB_framebuffer_object") != 0);
- assert(extensions.count("GL_ARB_texture_float") != 0);
+ assert(glewIsSupported("GL_ARB_framebuffer_object") != 0);
+ assert(glewIsSupported("GL_ARB_texture_float") != 0);
// We assume that we can use non-power-of-two textures without restrictions.
- assert(extensions.count("GL_ARB_texture_non_power_of_two") != 0);
+ assert(glewIsSupported("GL_ARB_texture_non_power_of_two") != 0);
// We also need GLSL fragment shaders.
- assert(extensions.count("GL_ARB_fragment_shader") != 0);
- assert(extensions.count("GL_ARB_shading_language_100") != 0);
+ assert(glewIsSupported("GL_ARB_fragment_shader") != 0);
+ assert(glewIsSupported("GL_ARB_shading_language_100") != 0);
// FlatInput and YCbCrInput uses PBOs. (They could in theory do without,
// but no modern card would really not provide it.)
- assert(extensions.count("GL_ARB_pixel_buffer_object") != 0);
+ assert(glewIsSupported("GL_ARB_pixel_buffer_object") != 0);
// ResampleEffect uses RG textures to encode a two-component LUT.
- assert(extensions.count("GL_ARB_texture_rg") != 0);
+ assert(glewIsSupported("GL_ARB_texture_rg") != 0);
// sRGB texture decode would be nice, but are not mandatory
// (GammaExpansionEffect can do the same thing if needed).
- movit_srgb_textures_supported = extensions.count("GL_EXT_texture_sRGB");
+ movit_srgb_textures_supported = glewIsSupported("GL_EXT_texture_sRGB");
}
} // namespace
return;
}
+ glewInit();
+
// geez
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
#include <math.h>
+#include <GL/glew.h>
#include "lift_gamma_gain_effect.h"
#include "util.h"
-#include "opengl.h"
LiftGammaGainEffect::LiftGammaGainEffect()
: lift(0.0f, 0.0f, 0.0f),
+++ /dev/null
-#ifndef _OPENGL_H
-#define _OPENGL_H 1
-
-// A common place to find OpenGL includes, if your system should have them in weird places.
-
-#define GL_GLEXT_PROTOTYPES 1
-
-#include <GL/gl.h>
-#include <GL/glext.h>
-
-#endif // !defined(_OPENGL_H)
#include <math.h>
#include <assert.h>
+#include <GL/glew.h>
#include "resample_effect.h"
#include "effect_chain.h"
#include "util.h"
-#include "opengl.h"
namespace {
#include <math.h>
#include <assert.h>
+#include <GL/glew.h>
#include "sandbox_effect.h"
#include "util.h"
-#include "opengl.h"
SandboxEffect::SandboxEffect()
: parm(0.0f)
#include <stdio.h>
+#include <math.h>
#include <string.h>
#include <assert.h>
+#include <GL/glew.h>
-#include <math.h>
#include "util.h"
-#include "opengl.h"
#include "init.h"
void hsv2rgb(float h, float s, float v, float *r, float *g, float *b)
#include <string>
#include <Eigen/Core>
-#include "opengl.h"
+#include <GL/glew.h>
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
#include <math.h>
+#include <GL/glew.h>
#include "vignette_effect.h"
#include "util.h"
-#include "opengl.h"
VignetteEffect::VignetteEffect()
: center(0.5f, 0.5f),
#include <math.h>
#include <assert.h>
+#include <GL/glew.h>
#include <Eigen/LU>
#include "white_balance_effect.h"
#include "util.h"
-#include "opengl.h"
#include "d65.h"
using namespace Eigen;
#include <math.h>
+#include <GL/glew.h>
#include "widgets.h"
#include "util.h"
-#include "opengl.h"
#define HSV_WHEEL_SIZE 128
#include <string.h>
#include <assert.h>
+#include <GL/glew.h>
#include <Eigen/LU>
#include "ycbcr_input.h"
#include "util.h"
-#include "opengl.h"
using namespace Eigen;