From 6a2b9ec988bfd69c8e290e4f22fe58364fb585c2 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Fri, 14 Apr 2017 13:42:17 -0700 Subject: [PATCH] rm-old: remove old things (but come back here for ios & windows integration) (#41) --- old/Makefile | 34 - old/betterpoints.cc | 125 - old/draw.c | 68 - old/fragment.glsl | 11 - old/math_3d.h | 369 -- old/miners.c | 54 - old/miners.cc | 106 - old/ogldev_types.h | 31 - old/ogldev_util.h | 83 - old/opengl-series.sln | 64 - old/opengl-series.xcodeproj/project.pbxproj | 1423 ----- old/pixels.c | 109 - .../04_camera.xcodeproj/project.pbxproj | 386 -- .../04_camera/resources/fragment-shader.txt | 10 - .../ios/04_camera/resources/vertex-shader.txt | 17 - .../ios/04_camera/resources/wooden-crate.jpg | Bin 49767 -> 0 bytes old/platforms/ios/04_camera/source/iOS_main.h | 30 - .../ios/04_camera/source/iOS_main.mm | 266 - .../source/ios_specific/WLAppDelegate.h | 19 - .../source/ios_specific/WLAppDelegate.mm | 59 - .../source/ios_specific/WLViewController.h | 14 - .../source/ios_specific/WLViewController.mm | 198 - .../ios/04_camera/source/ios_specific/main.m | 18 - .../ios/04_camera/source/tdogl/Bitmap.cpp | 352 -- .../ios/04_camera/source/tdogl/Bitmap.h | 142 - .../ios/04_camera/source/tdogl/Camera.cpp | 146 - .../ios/04_camera/source/tdogl/Camera.h | 160 - .../ios/04_camera/source/tdogl/Program.cpp | 199 - .../ios/04_camera/source/tdogl/Program.h | 116 - .../ios/04_camera/source/tdogl/Shader.cpp | 119 - .../ios/04_camera/source/tdogl/Shader.h | 75 - .../ios/04_camera/source/tdogl/Texture.cpp | 75 - .../ios/04_camera/source/tdogl/Texture.h | 76 - .../sys/01_project_skeleton-Info.plist | 47 - .../sys/01_project_skeleton-Prefix.pch | 14 - .../ios/04_camera/sys/Default-568h@2x.png | Bin 18594 -> 0 bytes old/platforms/ios/04_camera/sys/Default.png | Bin 6540 -> 0 bytes .../ios/04_camera/sys/Default@2x.png | Bin 16107 -> 0 bytes .../thirdparty/stb_image/stb_image.c | 4672 ----------------- old/platforms/linux/Makefile | 34 - old/platforms/linux/miners-app.make | 182 - old/platforms/linux/platform_linux.cpp | 100 - old/platforms/linux/premake4.lua | 56 - old/platforms/osx/platform_osx.mm | 15 - old/platforms/windows/04_camera.vcxproj | 106 - .../windows/04_camera.vcxproj.filters | 73 - old/platforms/windows/glfw3.lib | Bin 122534 -> 0 bytes old/platforms/windows/platform_windows.cpp | 12 - .../windows/shared_build_settings.props | 27 - old/point.cc | 29 - old/point.h | 28 - old/points.c | 168 - old/shaders.hh | 6 - old/vector3.h | 143 - old/vertex.glsl | 13 - 55 files changed, 10679 deletions(-) delete mode 100644 old/Makefile delete mode 100644 old/betterpoints.cc delete mode 100644 old/draw.c delete mode 100644 old/fragment.glsl delete mode 100644 old/math_3d.h delete mode 100644 old/miners.c delete mode 100644 old/miners.cc delete mode 100644 old/ogldev_types.h delete mode 100644 old/ogldev_util.h delete mode 100644 old/opengl-series.sln delete mode 100644 old/opengl-series.xcodeproj/project.pbxproj delete mode 100644 old/pixels.c delete mode 100644 old/platforms/ios/04_camera/04_camera.xcodeproj/project.pbxproj delete mode 100644 old/platforms/ios/04_camera/resources/fragment-shader.txt delete mode 100644 old/platforms/ios/04_camera/resources/vertex-shader.txt delete mode 100644 old/platforms/ios/04_camera/resources/wooden-crate.jpg delete mode 100644 old/platforms/ios/04_camera/source/iOS_main.h delete mode 100644 old/platforms/ios/04_camera/source/iOS_main.mm delete mode 100644 old/platforms/ios/04_camera/source/ios_specific/WLAppDelegate.h delete mode 100644 old/platforms/ios/04_camera/source/ios_specific/WLAppDelegate.mm delete mode 100644 old/platforms/ios/04_camera/source/ios_specific/WLViewController.h delete mode 100644 old/platforms/ios/04_camera/source/ios_specific/WLViewController.mm delete mode 100644 old/platforms/ios/04_camera/source/ios_specific/main.m delete mode 100644 old/platforms/ios/04_camera/source/tdogl/Bitmap.cpp delete mode 100644 old/platforms/ios/04_camera/source/tdogl/Bitmap.h delete mode 100644 old/platforms/ios/04_camera/source/tdogl/Camera.cpp delete mode 100644 old/platforms/ios/04_camera/source/tdogl/Camera.h delete mode 100644 old/platforms/ios/04_camera/source/tdogl/Program.cpp delete mode 100644 old/platforms/ios/04_camera/source/tdogl/Program.h delete mode 100644 old/platforms/ios/04_camera/source/tdogl/Shader.cpp delete mode 100644 old/platforms/ios/04_camera/source/tdogl/Shader.h delete mode 100644 old/platforms/ios/04_camera/source/tdogl/Texture.cpp delete mode 100644 old/platforms/ios/04_camera/source/tdogl/Texture.h delete mode 100644 old/platforms/ios/04_camera/sys/01_project_skeleton-Info.plist delete mode 100644 old/platforms/ios/04_camera/sys/01_project_skeleton-Prefix.pch delete mode 100644 old/platforms/ios/04_camera/sys/Default-568h@2x.png delete mode 100644 old/platforms/ios/04_camera/sys/Default.png delete mode 100644 old/platforms/ios/04_camera/sys/Default@2x.png delete mode 100644 old/platforms/ios/04_camera/thirdparty/stb_image/stb_image.c delete mode 100644 old/platforms/linux/Makefile delete mode 100644 old/platforms/linux/miners-app.make delete mode 100644 old/platforms/linux/platform_linux.cpp delete mode 100644 old/platforms/linux/premake4.lua delete mode 100644 old/platforms/osx/platform_osx.mm delete mode 100644 old/platforms/windows/04_camera.vcxproj delete mode 100644 old/platforms/windows/04_camera.vcxproj.filters delete mode 100644 old/platforms/windows/glfw3.lib delete mode 100644 old/platforms/windows/platform_windows.cpp delete mode 100644 old/platforms/windows/shared_build_settings.props delete mode 100644 old/point.cc delete mode 100644 old/point.h delete mode 100644 old/points.c delete mode 100644 old/shaders.hh delete mode 100644 old/vector3.h delete mode 100644 old/vertex.glsl diff --git a/old/Makefile b/old/Makefile deleted file mode 100644 index 3720913..0000000 --- a/old/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -CC := clang++ -CXX := clang++ -CFLAGS += -Wall -Wextra -std=c99 -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunreachable-code -g3 -LDFLAGS := -lGL -lGLU -lm -lglut -lglfw -lGLEW -CXXFLAGS += -Wall -Wextra -std=c++1y -CXXFLAGS += -g3 - -TARGET := miners -# SRC := pixels.c -SRC := points.c shaders.cc -OBJ := $(SRC:.c=.o) - -all: $(TARGET) - -run: $(TARGET) - ./$< - -$(TARGET): $(OBJ) - $(CC) $(LDFLAGS) -o $@ $^ - -%.o: %.c - $(CXX) $(CXXFLAGS) -c -o $@ $< - -%.o: %.cc - $(CXX) $(CXXFLAGS) -c -o $@ $< - -clean:: - $(if $(wildcard $(OBJ)), $(RM) $(OBJ)) - -nuke:: clean - $(RM) $(TARGET) - -distclean:: clean - $(if $(wildcard $(TARGET)), $(RM) $(TARGET)) diff --git a/old/betterpoints.cc b/old/betterpoints.cc deleted file mode 100644 index 045ccf4..0000000 --- a/old/betterpoints.cc +++ /dev/null @@ -1,125 +0,0 @@ -#include -#include -#include -#include "point.h" - -GLfloat mouseX_, mouseY_; //posicao inicial do cursor -bool rotationing = true; -GLfloat matrix [] = {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}; - -std::vector points; -bool mousePlot = true; - -void -display(void) { -/* display callback, clear frame buffer and z buffer, - plot points and draw references, swap buffers */ - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glutWireTeapot(100); - - for (size_t i = 0; i < points.size(); i++) { - glBegin(GL_POINTS); - glColor3f(1.0,0.0,0.1); - glPointSize(100); - glVertex3f(points.at(i).x, points.at(i).y, points.at(i).z); - glEnd(); - } - - glFlush(); - glutSwapBuffers(); -} - -void mouse(int btn, int state, int x, int y) -{ - - if(btn == GLUT_LEFT_BUTTON && mousePlot){ - float x_ = (float) x - glutGet(GLUT_WINDOW_WIDTH)/2; - float y_ = (float) -(y - glutGet(GLUT_WINDOW_HEIGHT)/2); - float z = 0.0; - - Point *p = new Point(x_,y_,z); - - points.push_back(*p); - } - - if(btn == GLUT_RIGHT_BUTTON){ - mousePlot = !mousePlot; - } - -} - -void myReshape(int w, int h) -{ - float nRange = w/2; - glViewport(0, 0, w, h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-w/2, w/2, -h/2, h/2, -nRange, nRange); - glMatrixMode(GL_MODELVIEW); -} - -void trackball(int PX, int PY){ - - //mouse = anterior position - //P = position in use - - if (rotationing && !mousePlot){ - GLint W = glutGet(GLUT_WINDOW_WIDTH); - GLint H = glutGet(GLUT_WINDOW_HEIGHT); - - GLfloat ray; //for while, i needn't take the sqrt for the ray. - if (W>H) ray=W*W/2; - else ray=H*H/2; - - mouseX_ -= W/2; // - GLfloat px = PX - W/2; // this part is to use the center - mouseY_ = H/2 - mouseY_; // of the screen as the origin - GLfloat py = H/2 - PY; // - //the idea is to find the Z coordinate of the two points in sphere's surface centered in the origin - GLfloat mouseX_Y2 = mouseX_*mouseX_ + mouseY_*mouseY_; - GLfloat pXY2 = px*px+py*py; - - if (mouseX_Y2 < ray && pXY2 < ray){ //this trackball only works for points inside the sphere - - GLfloat mouseZ = sqrt(ray - mouseX_Y2); - - GLfloat pz = sqrt(ray - pXY2); - - GLfloat axisRotation[3]; //vector product "mouse X P" - axisRotation[0] = -mouseZ*py + mouseY_*pz; - axisRotation[1] = mouseZ*px - mouseX_*pz; - axisRotation[2] = -mouseY_*px + mouseX_*py; - - GLfloat anguloRotacao = atan(sqrt(axisRotation[0]*axisRotation[0] + axisRotation[1]*axisRotation[1] + axisRotation[2]*axisRotation[2])); - - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glRotatef(anguloRotacao,axisRotation[0],axisRotation[1],axisRotation[2]); - glMultMatrixf(matrix); - glGetFloatv(GL_MODELVIEW_MATRIX, matrix); - } - } - mouseX_ = PX; - mouseY_ = PY; - glutPostRedisplay(); - -} - -int -main(int argc, char **argv) -{ - glutInit(&argc, argv); -/* need both double buffering and z buffer */ - glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); - glutInitWindowSize(640, 480); - glutCreateWindow("draw :)"); - glutReshapeFunc(myReshape); - glutDisplayFunc(display); - glutMouseFunc(mouse); - glutMotionFunc(trackball); - glEnable(GL_DEPTH_TEST); /* Enable hidden--surface--removal */ - glutMainLoop(); - return 0; -} diff --git a/old/draw.c b/old/draw.c deleted file mode 100644 index 5d33009..0000000 --- a/old/draw.c +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include - -#define W 260 -#define H 260 - -static -void -display() { - glClearColor(0, 0, 0, 1); - glClear(GL_COLOR_BUFFER_BIT); - - unsigned data[3 * W * H]; - /* for (size_t y = 0; y < W; ++y) { */ - /* for (size_t x = 0; x < H; ++x) { */ - /* data[3 * (x + W * y) + 0] = ( rand() % 255 ) * 255 * 255 * 255; */ - /* data[3 * (x + W * y) + 1] = ( rand() % 255 ) * 255 * 255 * 255; */ - /* data[3 * (x + W * y) + 2] = ( rand() % 255 ) * 255 * 255 * 255; */ - /* /\* data[2][x][y] = ( rand() % 255 ) * 255 * 255 * 255; *\/ */ - /* } */ - /* } */ - - for (size_t i = 0; i < 3 * W * H; ++i) { - /* unsigned current; */ - /* if (1 == fread(¤t, 1, 1, stdin)) { */ - data[i] = 150; - /* data[3 * (x + W * y) + 0] = 1; */ - /* data[3 * (x + W * y) + 1] = 1; */ - /* data[3 * (x + W * y) + 2] = 1; */ - /* } else { */ - /* perror("read"); */ - /* exit(1); */ - /* } */ - } - - glDrawPixels(W, H, GL_RGB, GL_UNSIGNED_INT, data); - - glutSwapBuffers(); -} - - -static -void -Key(unsigned char key, int x, int y) { - (void) x; - (void) y; - switch (key) { - case 'q': - case 'Q': - case 27: - exit(0); - break; - } -} - - -int -main(int argc, char **argv) { - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE); - glutInitWindowSize(W, H); - glutCreateWindow("miners"); - glutDisplayFunc(display); - glutKeyboardFunc(Key); - glutMainLoop(); - return 0; -} diff --git a/old/fragment.glsl b/old/fragment.glsl deleted file mode 100644 index 4d65de6..0000000 --- a/old/fragment.glsl +++ /dev/null @@ -1,11 +0,0 @@ -#version 320 es - -precision lowp float; - -in vec3 fragmentColors; -out vec3 color; - -void main() { - //color = fragmentColors; - color = vec3(1,0,0); -} diff --git a/old/math_3d.h b/old/math_3d.h deleted file mode 100644 index 52bb405..0000000 --- a/old/math_3d.h +++ /dev/null @@ -1,369 +0,0 @@ -/* - - Copyright 2010 Etay Meiri - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef MATH_3D_H -#define MATH_3D_H - -#include -#ifdef WIN32 -#define _USE_MATH_DEFINES -#include -#else -#include -#endif - -#include "vector3.h" -#include "matrix3x3.h" -#include "matrix4x4.h" - -#include "ogldev_util.h" - -#define ToRadian(x) (float)(((x) * M_PI / 180.0f)) -#define ToDegree(x) (float)(((x) * 180.0f / M_PI)) - -float RandomFloat(); - -struct Vector2i -{ - int x; - int y; -}; - -struct Vector2f -{ - float x; - float y; - - Vector2f() - { - } - - Vector2f(float _x, float _y) - { - x = _x; - y = _y; - } -}; - - -struct Vector3f -{ - float x; - float y; - float z; - - Vector3f() {} - - Vector3f(float _x, float _y, float _z) - { - x = _x; - y = _y; - z = _z; - } - - Vector3f(const float* pFloat) - { - x = pFloat[0]; - y = pFloat[0]; - z = pFloat[0]; - } - - Vector3f(float f) - { - x = y = z = f; - } - - Vector3f& operator+=(const Vector3f& r) - { - x += r.x; - y += r.y; - z += r.z; - - return *this; - } - - Vector3f& operator-=(const Vector3f& r) - { - x -= r.x; - y -= r.y; - z -= r.z; - - return *this; - } - - Vector3f& operator*=(float f) - { - x *= f; - y *= f; - z *= f; - - return *this; - } - - operator const float*() const - { - return &(x); - } - - - Vector3f Cross(const Vector3f& v) const; - - Vector3f& Normalize(); - - void Rotate(float Angle, const Vector3f& Axis); - - void Print() const - { - printf("(%.02f, %.02f, %.02f)", x, y, z); - } -}; - - -struct Vector4f -{ - float x; - float y; - float z; - float w; - - Vector4f() - { - } - - Vector4f(float _x, float _y, float _z, float _w) - { - x = _x; - y = _y; - z = _z; - w = _w; - } - - void Print(bool endl = true) const - { - printf("(%.02f, %.02f, %.02f, %.02f)", x, y, z, w); - - if (endl) { - printf("\n"); - } - } - - Vector3f to3f() const - { - Vector3f v(x, y, z); - return v; - } -}; - - - -inline Vector3f operator+(const Vector3f& l, const Vector3f& r) -{ - Vector3f Ret(l.x + r.x, - l.y + r.y, - l.z + r.z); - - return Ret; -} - -inline Vector3f operator-(const Vector3f& l, const Vector3f& r) -{ - Vector3f Ret(l.x - r.x, - l.y - r.y, - l.z - r.z); - - return Ret; -} - -inline Vector3f operator*(const Vector3f& l, float f) -{ - Vector3f Ret(l.x * f, - l.y * f, - l.z * f); - - return Ret; -} - - -inline Vector4f operator/(const Vector4f& l, float f) -{ - Vector4f Ret(l.x / f, - l.y / f, - l.z / f, - l.w / f); - - return Ret; -} - - -struct PersProjInfo -{ - float FOV; - float Width; - float Height; - float zNear; - float zFar; -}; - - -struct OrthoProjInfo -{ - float r; // right - float l; // left - float b; // bottom - float t; // top - float n; // z near - float f; // z far -}; - -struct Quaternion -{ - float x, y, z, w; - - Quaternion(float _x, float _y, float _z, float _w); - - void Normalize(); - - Quaternion Conjugate(); - - Vector3f ToDegrees(); - }; - - -class Matrix4f -{ -public: - float m[4][4]; - - Matrix4f() - { - } - - // constructor from Assimp matrix - Matrix4f(const aiMatrix4x4& AssimpMatrix) - { - m[0][0] = AssimpMatrix.a1; m[0][1] = AssimpMatrix.a2; m[0][2] = AssimpMatrix.a3; m[0][3] = AssimpMatrix.a4; - m[1][0] = AssimpMatrix.b1; m[1][1] = AssimpMatrix.b2; m[1][2] = AssimpMatrix.b3; m[1][3] = AssimpMatrix.b4; - m[2][0] = AssimpMatrix.c1; m[2][1] = AssimpMatrix.c2; m[2][2] = AssimpMatrix.c3; m[2][3] = AssimpMatrix.c4; - m[3][0] = AssimpMatrix.d1; m[3][1] = AssimpMatrix.d2; m[3][2] = AssimpMatrix.d3; m[3][3] = AssimpMatrix.d4; - } - - Matrix4f(const aiMatrix3x3& AssimpMatrix) - { - m[0][0] = AssimpMatrix.a1; m[0][1] = AssimpMatrix.a2; m[0][2] = AssimpMatrix.a3; m[0][3] = 0.0f; - m[1][0] = AssimpMatrix.b1; m[1][1] = AssimpMatrix.b2; m[1][2] = AssimpMatrix.b3; m[1][3] = 0.0f; - m[2][0] = AssimpMatrix.c1; m[2][1] = AssimpMatrix.c2; m[2][2] = AssimpMatrix.c3; m[2][3] = 0.0f; - m[3][0] = 0.0f ; m[3][1] = 0.0f ; m[3][2] = 0.0f ; m[3][3] = 1.0f; - } - - Matrix4f(float a00, float a01, float a02, float a03, - float a10, float a11, float a12, float a13, - float a20, float a21, float a22, float a23, - float a30, float a31, float a32, float a33) - { - m[0][0] = a00; m[0][1] = a01; m[0][2] = a02; m[0][3] = a03; - m[1][0] = a10; m[1][1] = a11; m[1][2] = a12; m[1][3] = a13; - m[2][0] = a20; m[2][1] = a21; m[2][2] = a22; m[2][3] = a23; - m[3][0] = a30; m[3][1] = a31; m[3][2] = a32; m[3][3] = a33; - } - - void SetZero() - { - ZERO_MEM(m); - } - - Matrix4f Transpose() const - { - Matrix4f n; - - for (unsigned int i = 0 ; i < 4 ; i++) { - for (unsigned int j = 0 ; j < 4 ; j++) { - n.m[i][j] = m[j][i]; - } - } - - return n; - } - - - inline void InitIdentity() - { - m[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = 0.0f; - m[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = 0.0f; - m[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = 0.0f; - m[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f; - } - - inline Matrix4f operator*(const Matrix4f& Right) const - { - Matrix4f Ret; - - for (unsigned int i = 0 ; i < 4 ; i++) { - for (unsigned int j = 0 ; j < 4 ; j++) { - Ret.m[i][j] = m[i][0] * Right.m[0][j] + - m[i][1] * Right.m[1][j] + - m[i][2] * Right.m[2][j] + - m[i][3] * Right.m[3][j]; - } - } - - return Ret; - } - - Vector4f operator*(const Vector4f& v) const - { - Vector4f r; - - r.x = m[0][0]* v.x + m[0][1]* v.y + m[0][2]* v.z + m[0][3]* v.w; - r.y = m[1][0]* v.x + m[1][1]* v.y + m[1][2]* v.z + m[1][3]* v.w; - r.z = m[2][0]* v.x + m[2][1]* v.y + m[2][2]* v.z + m[2][3]* v.w; - r.w = m[3][0]* v.x + m[3][1]* v.y + m[3][2]* v.z + m[3][3]* v.w; - - return r; - } - - operator const float*() const - { - return &(m[0][0]); - } - - void Print() const - { - for (int i = 0 ; i < 4 ; i++) { - printf("%f %f %f %f\n", m[i][0], m[i][1], m[i][2], m[i][3]); - } - } - - float Determinant() const; - - Matrix4f& Inverse(); - - void InitScaleTransform(float ScaleX, float ScaleY, float ScaleZ); - void InitRotateTransform(float RotateX, float RotateY, float RotateZ); - void InitRotateTransform(const Quaternion& quat); - void InitTranslationTransform(float x, float y, float z); - void InitCameraTransform(const Vector3f& Target, const Vector3f& Up); - void InitPersProjTransform(const PersProjInfo& p); - void InitOrthoProjTransform(const OrthoProjInfo& p); -}; - -Quaternion operator*(const Quaternion& l, const Quaternion& r); - -Quaternion operator*(const Quaternion& q, const Vector3f& v); - -#endif /* MATH_3D_H */ - diff --git a/old/miners.c b/old/miners.c deleted file mode 100644 index 3886e59..0000000 --- a/old/miners.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include - -#define WIDTH 300 -#define HEIGHT 300 - -// window id -int window; - - -void -display(void) { - glClear(GL_COLOR_BUFFER_BIT); - glColor3f(0.0, 1.0, 0.0); - glBegin(GL_POLYGON); - glVertex3f(2.0, 4.0, 0.0); - glVertex3f(8.0, 4.0, 0.0); - glVertex3f(8.0, 6.0, 0.0); - glVertex3f(2.0, 6.0, 0.0); - glEnd(); - glFlush(); -} - -void -keyPressed (unsigned char key, int x, int y) { - switch (key) { - case 'q': - case 27: // ESCAPE - glutDestroyWindow(window); - exit(0); - } -} - - -int -main(int argc, char **argv) { - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH); - - glutInitWindowPosition(100, 100); - glutInitWindowSize(WIDTH, HEIGHT); - window = glutCreateWindow("miners"); - - glClearColor(0.0, 0.0, 0.0, 0.0); // black background - glMatrixMode(GL_PROJECTION); // setup viewing projection - glLoadIdentity(); // start with identity matrix - glOrtho(0.0, 10.0, 0.0, 10.0, -1.0, 1.0); // setup a 10x10x2 viewing world - - glutDisplayFunc(display); - glutKeyboardFunc(keyPressed); - glutMainLoop(); - - return 0; -} diff --git a/old/miners.cc b/old/miners.cc deleted file mode 100644 index 1f0ca55..0000000 --- a/old/miners.cc +++ /dev/null @@ -1,106 +0,0 @@ -#include -#include - -#include - -#include -//#include - -#include -using namespace glm; - - -// Our vertices. Three consecutive floats give a 3D vertex; Three consecutive vertices give a triangle. -// A cube has 6 faces with 2 triangles each, so this makes 6*2=12 triangles, and 12*3 vertices -static const GLfloat g_vertex_buffer_data[] = { - -1.0f,-1.0f,-1.0f, // triangle 1 : begin - -1.0f,-1.0f, 1.0f, - -1.0f, 1.0f, 1.0f, // triangle 1 : end - 1.0f, 1.0f,-1.0f, // triangle 2 : begin - -1.0f,-1.0f,-1.0f, - -1.0f, 1.0f,-1.0f, // triangle 2 : end - 1.0f,-1.0f, 1.0f, - -1.0f,-1.0f,-1.0f, - 1.0f,-1.0f,-1.0f, - 1.0f, 1.0f,-1.0f, - 1.0f,-1.0f,-1.0f, - -1.0f,-1.0f,-1.0f, - -1.0f,-1.0f,-1.0f, - -1.0f, 1.0f, 1.0f, - -1.0f, 1.0f,-1.0f, - 1.0f,-1.0f, 1.0f, - -1.0f,-1.0f, 1.0f, - -1.0f,-1.0f,-1.0f, - -1.0f, 1.0f, 1.0f, - -1.0f,-1.0f, 1.0f, - 1.0f,-1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, - 1.0f,-1.0f,-1.0f, - 1.0f, 1.0f,-1.0f, - 1.0f,-1.0f,-1.0f, - 1.0f, 1.0f, 1.0f, - 1.0f,-1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f,-1.0f, - -1.0f, 1.0f,-1.0f, - 1.0f, 1.0f, 1.0f, - -1.0f, 1.0f,-1.0f, - -1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, - -1.0f, 1.0f, 1.0f, - 1.0f,-1.0f, 1.0f -}; - - -int main( void ) -{ - // Initialise GLFW - if( !glfwInit() ) - { - fprintf( stderr, "Failed to initialize GLFW\n" ); - return -1; - } - - glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4); - glfwOpenWindowHint(GLFW_WINDOW_NO_RESIZE,GL_TRUE); - glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); - glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3); - glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - - // Open a window and create its OpenGL context - if( !glfwOpenWindow( 1024, 768, 0,0,0,0, 32,0, GLFW_WINDOW ) ) - { - fprintf( stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n" ); - glfwTerminate(); - return -1; - } - - // Initialize GLEW - if (glewInit() != GLEW_OK) { - fprintf(stderr, "Failed to initialize GLEW\n"); - return -1; - } - - glfwSetWindowTitle( "Playground" ); - - // Ensure we can capture the escape key being pressed below - glfwEnable( GLFW_STICKY_KEYS ); - - // Dark blue background - glClearColor(0.0f, 0.0f, 0.3f, 0.0f); - - do{ - // Draw nothing, see you in tutorial 2 ! - - // Swap buffers - glfwSwapBuffers(); - - } // Check if the ESC key was pressed or the window was closed - while( glfwGetKey( GLFW_KEY_ESC ) != GLFW_PRESS && - glfwGetWindowParam( GLFW_OPENED ) ); - - // Close OpenGL window and terminate GLFW - glfwTerminate(); - - return 0; -} diff --git a/old/ogldev_types.h b/old/ogldev_types.h deleted file mode 100644 index 3af5840..0000000 --- a/old/ogldev_types.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - - Copyright 2011 Etay Meiri - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef OGLDEV_TYPES_H -#define OGLDEV_TYPES_H - -#ifndef WIN32 -#include -#endif - -typedef unsigned int uint; -typedef unsigned short ushort; -typedef unsigned char uchar; - -#endif /* OGLDEV_TYPES_H */ - diff --git a/old/ogldev_util.h b/old/ogldev_util.h deleted file mode 100644 index d1bf3cc..0000000 --- a/old/ogldev_util.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - - Copyright 2014 Etay Meiri - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef OGLDEV_UTIL_H -#define OGLDEV_UTIL_H - -#ifndef WIN32 -#include -#endif -#include -#include -#include -#include -#include -#include "ogldev_types.h" - -using namespace std; - -bool ReadFile(const char* fileName, string& outFile); - -void OgldevError(const char* pFileName, uint line, const char* pError); -void OgldevFileError(const char* pFileName, uint line, const char* pFileError); - -#define OGLDEV_ERROR(Error) OgldevError(__FILE__, __LINE__, Error); -#define OGLDEV_FILE_ERROR(FileError) OgldevFileError(__FILE__, __LINE__, FileError); - -#define ZERO_MEM(a) memset(a, 0, sizeof(a)) -#define ARRAY_SIZE_IN_ELEMENTS(a) (sizeof(a)/sizeof(a[0])) - -#ifdef WIN32 -#define SNPRINTF _snprintf_s -#define RANDOM rand -#define SRANDOM srand((unsigned)time(NULL)) -#if (_MSC_VER == 1900) -#elif (_MSC_VER == 1800) -#else -float fmax(float a, float b); -#endif -#else -#define SNPRINTF snprintf -#define RANDOM random -#define SRANDOM srandom(getpid()) -#endif - -#define INVALID_UNIFORM_LOCATION 0xffffffff -#define INVALID_OGL_VALUE 0xffffffff - -#define SAFE_DELETE(p) if (p) { delete p; p = NULL; } - -#define GLExitIfError \ -{ \ - GLenum Error = glGetError(); \ - \ - if (Error != GL_NO_ERROR) { \ - printf("OpenGL error in %s:%d: 0x%x\n", __FILE__, __LINE__, Error); \ - exit(0); \ - } \ -} - -#define GLCheckError() (glGetError() == GL_NO_ERROR) - -long long GetCurrentTimeMillis(); - - -#define ASSIMP_LOAD_FLAGS (aiProcess_Triangulate | aiProcess_GenSmoothNormals | aiProcess_FlipUVs | aiProcess_JoinIdenticalVertices) - -#endif /* OGLDEV_UTIL_H */ - diff --git a/old/opengl-series.sln b/old/opengl-series.sln deleted file mode 100644 index ed6f2c9..0000000 --- a/old/opengl-series.sln +++ /dev/null @@ -1,64 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Express 2013 for Windows Desktop -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01_project_skeleton", "platforms\windows\01_project_skeleton.vcxproj", "{0E839A2B-C52A-406F-B290-E21A585D9178}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02_textures", "platforms\windows\02_textures.vcxproj", "{872F49FD-A39D-4180-B5EC-52D4325FD9A3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03_matrices", "platforms\windows\03_matrices.vcxproj", "{2DD67AF3-0BB1-4E5D-AB2A-D777423F28BB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04_camera", "platforms\windows\04_camera.vcxproj", "{2AFCB852-7CC9-4B7A-A1C4-AF6565396B9C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05_asset_instance", "platforms\windows\05_asset_instance.vcxproj", "{E46A1BC9-C98D-432A-8BD5-04F6F41436DF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06_diffuse_lighting", "platforms\windows\06_diffuse_lighting.vcxproj", "{FC6C6DAB-BE5E-4DFA-ADE7-92FE4F71C043}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07_more_lighting", "platforms\windows\07_more_lighting.vcxproj", "{273F6D3E-1883-4F00-80A7-F86760A859D6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08_even_more_lighting", "platforms\windows\08_even_more_lighting.vcxproj", "{70A49527-59F2-4B07-8D5A-87C3D94FB802}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0E839A2B-C52A-406F-B290-E21A585D9178}.Debug|Win32.ActiveCfg = Debug|Win32 - {0E839A2B-C52A-406F-B290-E21A585D9178}.Debug|Win32.Build.0 = Debug|Win32 - {0E839A2B-C52A-406F-B290-E21A585D9178}.Release|Win32.ActiveCfg = Release|Win32 - {0E839A2B-C52A-406F-B290-E21A585D9178}.Release|Win32.Build.0 = Release|Win32 - {872F49FD-A39D-4180-B5EC-52D4325FD9A3}.Debug|Win32.ActiveCfg = Debug|Win32 - {872F49FD-A39D-4180-B5EC-52D4325FD9A3}.Debug|Win32.Build.0 = Debug|Win32 - {872F49FD-A39D-4180-B5EC-52D4325FD9A3}.Release|Win32.ActiveCfg = Release|Win32 - {872F49FD-A39D-4180-B5EC-52D4325FD9A3}.Release|Win32.Build.0 = Release|Win32 - {2DD67AF3-0BB1-4E5D-AB2A-D777423F28BB}.Debug|Win32.ActiveCfg = Debug|Win32 - {2DD67AF3-0BB1-4E5D-AB2A-D777423F28BB}.Debug|Win32.Build.0 = Debug|Win32 - {2DD67AF3-0BB1-4E5D-AB2A-D777423F28BB}.Release|Win32.ActiveCfg = Release|Win32 - {2DD67AF3-0BB1-4E5D-AB2A-D777423F28BB}.Release|Win32.Build.0 = Release|Win32 - {2AFCB852-7CC9-4B7A-A1C4-AF6565396B9C}.Debug|Win32.ActiveCfg = Debug|Win32 - {2AFCB852-7CC9-4B7A-A1C4-AF6565396B9C}.Debug|Win32.Build.0 = Debug|Win32 - {2AFCB852-7CC9-4B7A-A1C4-AF6565396B9C}.Release|Win32.ActiveCfg = Release|Win32 - {2AFCB852-7CC9-4B7A-A1C4-AF6565396B9C}.Release|Win32.Build.0 = Release|Win32 - {E46A1BC9-C98D-432A-8BD5-04F6F41436DF}.Debug|Win32.ActiveCfg = Debug|Win32 - {E46A1BC9-C98D-432A-8BD5-04F6F41436DF}.Debug|Win32.Build.0 = Debug|Win32 - {E46A1BC9-C98D-432A-8BD5-04F6F41436DF}.Release|Win32.ActiveCfg = Release|Win32 - {E46A1BC9-C98D-432A-8BD5-04F6F41436DF}.Release|Win32.Build.0 = Release|Win32 - {FC6C6DAB-BE5E-4DFA-ADE7-92FE4F71C043}.Debug|Win32.ActiveCfg = Debug|Win32 - {FC6C6DAB-BE5E-4DFA-ADE7-92FE4F71C043}.Debug|Win32.Build.0 = Debug|Win32 - {FC6C6DAB-BE5E-4DFA-ADE7-92FE4F71C043}.Release|Win32.ActiveCfg = Release|Win32 - {FC6C6DAB-BE5E-4DFA-ADE7-92FE4F71C043}.Release|Win32.Build.0 = Release|Win32 - {273F6D3E-1883-4F00-80A7-F86760A859D6}.Debug|Win32.ActiveCfg = Debug|Win32 - {273F6D3E-1883-4F00-80A7-F86760A859D6}.Debug|Win32.Build.0 = Debug|Win32 - {273F6D3E-1883-4F00-80A7-F86760A859D6}.Release|Win32.ActiveCfg = Release|Win32 - {273F6D3E-1883-4F00-80A7-F86760A859D6}.Release|Win32.Build.0 = Release|Win32 - {70A49527-59F2-4B07-8D5A-87C3D94FB802}.Debug|Win32.ActiveCfg = Debug|Win32 - {70A49527-59F2-4B07-8D5A-87C3D94FB802}.Debug|Win32.Build.0 = Debug|Win32 - {70A49527-59F2-4B07-8D5A-87C3D94FB802}.Release|Win32.ActiveCfg = Release|Win32 - {70A49527-59F2-4B07-8D5A-87C3D94FB802}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/old/opengl-series.xcodeproj/project.pbxproj b/old/opengl-series.xcodeproj/project.pbxproj deleted file mode 100644 index 97e7bdf..0000000 --- a/old/opengl-series.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1423 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - E2639951190D148400B6251A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639950190D148400B6251A /* Cocoa.framework */; }; - E2639987190D149C00B6251A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639950190D148400B6251A /* Cocoa.framework */; }; - E26399B8190D14B200B6251A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639950190D148400B6251A /* Cocoa.framework */; }; - E26399E9190D14C000B6251A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639950190D148400B6251A /* Cocoa.framework */; }; - E2639A1A190D14D100B6251A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639950190D148400B6251A /* Cocoa.framework */; }; - E2639A4B190D14E600B6251A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639950190D148400B6251A /* Cocoa.framework */; }; - E2639A7C190D14F500B6251A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639950190D148400B6251A /* Cocoa.framework */; }; - E2639AAD190D150700B6251A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639950190D148400B6251A /* Cocoa.framework */; }; - E2639AE3190D156500B6251A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639ADC190D156500B6251A /* main.cpp */; }; - E2639AE4190D156500B6251A /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639ADD190D156500B6251A /* Program.cpp */; }; - E2639AE5190D156500B6251A /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639ADF190D156500B6251A /* Shader.cpp */; }; - E2639AE8190D169200B6251A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AE7190D169200B6251A /* OpenGL.framework */; }; - E2639AFC190D16FF00B6251A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AFB190D16FF00B6251A /* IOKit.framework */; }; - E2639B00190D174200B6251A /* fragment-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639AFE190D174200B6251A /* fragment-shader.txt */; }; - E2639B08190D174200B6251A /* vertex-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639AFF190D174200B6251A /* vertex-shader.txt */; }; - E2639B20190D179B00B6251A /* fragment-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639B12190D179B00B6251A /* fragment-shader.txt */; }; - E2639B21190D179B00B6251A /* hazard.png in Resources */ = {isa = PBXBuildFile; fileRef = E2639B13190D179B00B6251A /* hazard.png */; }; - E2639B22190D179B00B6251A /* vertex-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639B14190D179B00B6251A /* vertex-shader.txt */; }; - E2639B23190D179B00B6251A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B16190D179B00B6251A /* main.cpp */; }; - E2639B24190D179B00B6251A /* Bitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B18190D179B00B6251A /* Bitmap.cpp */; }; - E2639B25190D179B00B6251A /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B1A190D179B00B6251A /* Program.cpp */; }; - E2639B26190D179B00B6251A /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B1C190D179B00B6251A /* Shader.cpp */; }; - E2639B27190D179B00B6251A /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B1E190D179B00B6251A /* Texture.cpp */; }; - E2639B28190D18DF00B6251A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AE7190D169200B6251A /* OpenGL.framework */; }; - E2639B29190D18E600B6251A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AFB190D16FF00B6251A /* IOKit.framework */; }; - E2639B3A190D1AE200B6251A /* fragment-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639B2C190D1AE200B6251A /* fragment-shader.txt */; }; - E2639B3B190D1AE200B6251A /* vertex-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639B2D190D1AE200B6251A /* vertex-shader.txt */; }; - E2639B3C190D1AE200B6251A /* wooden-crate.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E2639B2E190D1AE200B6251A /* wooden-crate.jpg */; }; - E2639B3D190D1AE200B6251A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B30190D1AE200B6251A /* main.cpp */; }; - E2639B3E190D1AE200B6251A /* Bitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B32190D1AE200B6251A /* Bitmap.cpp */; }; - E2639B3F190D1AE200B6251A /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B34190D1AE200B6251A /* Program.cpp */; }; - E2639B40190D1AE200B6251A /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B36190D1AE200B6251A /* Shader.cpp */; }; - E2639B41190D1AE200B6251A /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B38190D1AE200B6251A /* Texture.cpp */; }; - E2639B42190D1B0300B6251A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AE7190D169200B6251A /* OpenGL.framework */; }; - E2639B43190D1B0400B6251A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AE7190D169200B6251A /* OpenGL.framework */; }; - E2639B44190D1B0500B6251A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AE7190D169200B6251A /* OpenGL.framework */; }; - E2639B45190D1B0600B6251A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AE7190D169200B6251A /* OpenGL.framework */; }; - E2639B46190D1B0600B6251A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AE7190D169200B6251A /* OpenGL.framework */; }; - E2639B47190D1B0700B6251A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AE7190D169200B6251A /* OpenGL.framework */; }; - E2639B48190D1B1400B6251A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AFB190D16FF00B6251A /* IOKit.framework */; }; - E2639B49190D1B1500B6251A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AFB190D16FF00B6251A /* IOKit.framework */; }; - E2639B4A190D1B1500B6251A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AFB190D16FF00B6251A /* IOKit.framework */; }; - E2639B4B190D1B1600B6251A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AFB190D16FF00B6251A /* IOKit.framework */; }; - E2639B4C190D1B1700B6251A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AFB190D16FF00B6251A /* IOKit.framework */; }; - E2639B4D190D1B1700B6251A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2639AFB190D16FF00B6251A /* IOKit.framework */; }; - E2639B60190D1B5300B6251A /* fragment-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639B50190D1B5300B6251A /* fragment-shader.txt */; }; - E2639B61190D1B5300B6251A /* vertex-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639B51190D1B5300B6251A /* vertex-shader.txt */; }; - E2639B62190D1B5300B6251A /* wooden-crate.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E2639B52190D1B5300B6251A /* wooden-crate.jpg */; }; - E2639B63190D1B5300B6251A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B54190D1B5300B6251A /* main.cpp */; }; - E2639B64190D1B5300B6251A /* Bitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B56190D1B5300B6251A /* Bitmap.cpp */; }; - E2639B65190D1B5300B6251A /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B58190D1B5300B6251A /* Camera.cpp */; }; - E2639B66190D1B5300B6251A /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B5A190D1B5300B6251A /* Program.cpp */; }; - E2639B67190D1B5300B6251A /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B5C190D1B5300B6251A /* Shader.cpp */; }; - E2639B68190D1B5300B6251A /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B5E190D1B5300B6251A /* Texture.cpp */; }; - E2639B7B190D1B8F00B6251A /* fragment-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639B6B190D1B8F00B6251A /* fragment-shader.txt */; }; - E2639B7C190D1B8F00B6251A /* vertex-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639B6C190D1B8F00B6251A /* vertex-shader.txt */; }; - E2639B7D190D1B8F00B6251A /* wooden-crate.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E2639B6D190D1B8F00B6251A /* wooden-crate.jpg */; }; - E2639B7E190D1B8F00B6251A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B6F190D1B8F00B6251A /* main.cpp */; }; - E2639B7F190D1B8F00B6251A /* Bitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B71190D1B8F00B6251A /* Bitmap.cpp */; }; - E2639B80190D1B8F00B6251A /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B73190D1B8F00B6251A /* Camera.cpp */; }; - E2639B81190D1B8F00B6251A /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B75190D1B8F00B6251A /* Program.cpp */; }; - E2639B82190D1B8F00B6251A /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B77190D1B8F00B6251A /* Shader.cpp */; }; - E2639B83190D1B8F00B6251A /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B79190D1B8F00B6251A /* Texture.cpp */; }; - E2639B96190D1BC000B6251A /* fragment-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639B86190D1BC000B6251A /* fragment-shader.txt */; }; - E2639B97190D1BC100B6251A /* vertex-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639B87190D1BC000B6251A /* vertex-shader.txt */; }; - E2639B98190D1BC100B6251A /* wooden-crate.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E2639B88190D1BC000B6251A /* wooden-crate.jpg */; }; - E2639B99190D1BC100B6251A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B8A190D1BC000B6251A /* main.cpp */; }; - E2639B9A190D1BC100B6251A /* Bitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B8C190D1BC000B6251A /* Bitmap.cpp */; }; - E2639B9B190D1BC100B6251A /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B8E190D1BC000B6251A /* Camera.cpp */; }; - E2639B9C190D1BC100B6251A /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B90190D1BC000B6251A /* Program.cpp */; }; - E2639B9D190D1BC100B6251A /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B92190D1BC000B6251A /* Shader.cpp */; }; - E2639B9E190D1BC100B6251A /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639B94190D1BC000B6251A /* Texture.cpp */; }; - E2639BB1190D1BEC00B6251A /* fragment-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639BA1190D1BEC00B6251A /* fragment-shader.txt */; }; - E2639BB2190D1BEC00B6251A /* vertex-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639BA2190D1BEC00B6251A /* vertex-shader.txt */; }; - E2639BB3190D1BEC00B6251A /* wooden-crate.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E2639BA3190D1BEC00B6251A /* wooden-crate.jpg */; }; - E2639BB4190D1BEC00B6251A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BA5190D1BEC00B6251A /* main.cpp */; }; - E2639BB5190D1BEC00B6251A /* Bitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BA7190D1BEC00B6251A /* Bitmap.cpp */; }; - E2639BB6190D1BEC00B6251A /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BA9190D1BEC00B6251A /* Camera.cpp */; }; - E2639BB7190D1BEC00B6251A /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BAB190D1BEC00B6251A /* Program.cpp */; }; - E2639BB8190D1BEC00B6251A /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BAD190D1BEC00B6251A /* Shader.cpp */; }; - E2639BB9190D1BEC00B6251A /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BAF190D1BEC00B6251A /* Texture.cpp */; }; - E2639BCC190D1C1700B6251A /* fragment-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639BBC190D1C1700B6251A /* fragment-shader.txt */; }; - E2639BCD190D1C1700B6251A /* vertex-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2639BBD190D1C1700B6251A /* vertex-shader.txt */; }; - E2639BCE190D1C1700B6251A /* wooden-crate.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E2639BBE190D1C1700B6251A /* wooden-crate.jpg */; }; - E2639BCF190D1C1700B6251A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BC0190D1C1700B6251A /* main.cpp */; }; - E2639BD0190D1C1700B6251A /* Bitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BC2190D1C1700B6251A /* Bitmap.cpp */; }; - E2639BD1190D1C1700B6251A /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BC4190D1C1700B6251A /* Camera.cpp */; }; - E2639BD2190D1C1700B6251A /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BC6190D1C1700B6251A /* Program.cpp */; }; - E2639BD3190D1C1700B6251A /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BC8190D1C1700B6251A /* Shader.cpp */; }; - E2639BD4190D1C1700B6251A /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2639BCA190D1C1700B6251A /* Texture.cpp */; }; - E29C2A8D19FB7AA500A6FCD2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2A8C19FB7AA500A6FCD2 /* QuartzCore.framework */; }; - E29C2A8E19FB7AAD00A6FCD2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2A8C19FB7AA500A6FCD2 /* QuartzCore.framework */; }; - E29C2A8F19FB7AAE00A6FCD2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2A8C19FB7AA500A6FCD2 /* QuartzCore.framework */; }; - E29C2A9019FB7AAF00A6FCD2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2A8C19FB7AA500A6FCD2 /* QuartzCore.framework */; }; - E29C2A9119FB7AB000A6FCD2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2A8C19FB7AA500A6FCD2 /* QuartzCore.framework */; }; - E29C2A9219FB7AB100A6FCD2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2A8C19FB7AA500A6FCD2 /* QuartzCore.framework */; }; - E29C2A9319FB7AB100A6FCD2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2A8C19FB7AA500A6FCD2 /* QuartzCore.framework */; }; - E29C2A9419FB7AB200A6FCD2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2A8C19FB7AA500A6FCD2 /* QuartzCore.framework */; }; - E29C2ACA19FCA1C400A6FCD2 /* glew.c in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC919FCA1C400A6FCD2 /* glew.c */; }; - E29C2ACB19FCA1C400A6FCD2 /* glew.c in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC919FCA1C400A6FCD2 /* glew.c */; }; - E29C2ACC19FCA1C400A6FCD2 /* glew.c in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC919FCA1C400A6FCD2 /* glew.c */; }; - E29C2ACD19FCA1C400A6FCD2 /* glew.c in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC919FCA1C400A6FCD2 /* glew.c */; }; - E29C2ACE19FCA1C400A6FCD2 /* glew.c in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC919FCA1C400A6FCD2 /* glew.c */; }; - E29C2ACF19FCA1C400A6FCD2 /* glew.c in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC919FCA1C400A6FCD2 /* glew.c */; }; - E29C2AD019FCA1C400A6FCD2 /* glew.c in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC919FCA1C400A6FCD2 /* glew.c */; }; - E29C2AD119FCA1C400A6FCD2 /* glew.c in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC919FCA1C400A6FCD2 /* glew.c */; }; - E29C2AD219FCA21900A6FCD2 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2AC719FCA1A100A6FCD2 /* libglfw3.a */; }; - E29C2AD319FCA21C00A6FCD2 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2AC719FCA1A100A6FCD2 /* libglfw3.a */; }; - E29C2AD419FCA21C00A6FCD2 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2AC719FCA1A100A6FCD2 /* libglfw3.a */; }; - E29C2AD519FCA21D00A6FCD2 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2AC719FCA1A100A6FCD2 /* libglfw3.a */; }; - E29C2AD619FCA21E00A6FCD2 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2AC719FCA1A100A6FCD2 /* libglfw3.a */; }; - E29C2AD719FCA21F00A6FCD2 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2AC719FCA1A100A6FCD2 /* libglfw3.a */; }; - E29C2AD819FCA21F00A6FCD2 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2AC719FCA1A100A6FCD2 /* libglfw3.a */; }; - E29C2AD919FCA22100A6FCD2 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E29C2AC719FCA1A100A6FCD2 /* libglfw3.a */; }; - E29C2ADA19FCA22D00A6FCD2 /* platform_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC819FCA1A100A6FCD2 /* platform_osx.mm */; }; - E29C2ADB19FCA22E00A6FCD2 /* platform_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC819FCA1A100A6FCD2 /* platform_osx.mm */; }; - E29C2ADC19FCA22F00A6FCD2 /* platform_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC819FCA1A100A6FCD2 /* platform_osx.mm */; }; - E29C2ADD19FCA22F00A6FCD2 /* platform_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC819FCA1A100A6FCD2 /* platform_osx.mm */; }; - E29C2ADE19FCA23000A6FCD2 /* platform_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC819FCA1A100A6FCD2 /* platform_osx.mm */; }; - E29C2ADF19FCA23100A6FCD2 /* platform_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC819FCA1A100A6FCD2 /* platform_osx.mm */; }; - E29C2AE019FCA23100A6FCD2 /* platform_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC819FCA1A100A6FCD2 /* platform_osx.mm */; }; - E29C2AE119FCA23200A6FCD2 /* platform_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = E29C2AC819FCA1A100A6FCD2 /* platform_osx.mm */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - E263994D190D148400B6251A /* 01_project_skeleton.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 01_project_skeleton.app; sourceTree = BUILT_PRODUCTS_DIR; }; - E2639950190D148400B6251A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; - E2639986190D149C00B6251A /* 02_textures.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 02_textures.app; sourceTree = BUILT_PRODUCTS_DIR; }; - E26399B7190D14B200B6251A /* 03_matrices.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 03_matrices.app; sourceTree = BUILT_PRODUCTS_DIR; }; - E26399E8190D14C000B6251A /* 04_camera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 04_camera.app; sourceTree = BUILT_PRODUCTS_DIR; }; - E2639A19190D14D100B6251A /* 05_asset_instance.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 05_asset_instance.app; sourceTree = BUILT_PRODUCTS_DIR; }; - E2639A4A190D14E600B6251A /* 06_diffuse_lighting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 06_diffuse_lighting.app; sourceTree = BUILT_PRODUCTS_DIR; }; - E2639A7B190D14F500B6251A /* 07_more_lighting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 07_more_lighting.app; sourceTree = BUILT_PRODUCTS_DIR; }; - E2639AAC190D150700B6251A /* 08_even_more_lighting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 08_even_more_lighting.app; sourceTree = BUILT_PRODUCTS_DIR; }; - E2639ADC190D156500B6251A /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - E2639ADD190D156500B6251A /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = ""; }; - E2639ADE190D156500B6251A /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = ""; }; - E2639ADF190D156500B6251A /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; - E2639AE0190D156500B6251A /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; - E2639AE7190D169200B6251A /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; - E2639AFB190D16FF00B6251A /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; - E2639AFE190D174200B6251A /* fragment-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "fragment-shader.txt"; sourceTree = ""; }; - E2639AFF190D174200B6251A /* vertex-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "vertex-shader.txt"; sourceTree = ""; }; - E2639B12190D179B00B6251A /* fragment-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "fragment-shader.txt"; sourceTree = ""; }; - E2639B13190D179B00B6251A /* hazard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = hazard.png; sourceTree = ""; }; - E2639B14190D179B00B6251A /* vertex-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "vertex-shader.txt"; sourceTree = ""; }; - E2639B16190D179B00B6251A /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - E2639B18190D179B00B6251A /* Bitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bitmap.cpp; sourceTree = ""; }; - E2639B19190D179B00B6251A /* Bitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bitmap.h; sourceTree = ""; }; - E2639B1A190D179B00B6251A /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = ""; }; - E2639B1B190D179B00B6251A /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = ""; }; - E2639B1C190D179B00B6251A /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; - E2639B1D190D179B00B6251A /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; - E2639B1E190D179B00B6251A /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; }; - E2639B1F190D179B00B6251A /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; }; - E2639B2C190D1AE200B6251A /* fragment-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "fragment-shader.txt"; sourceTree = ""; }; - E2639B2D190D1AE200B6251A /* vertex-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "vertex-shader.txt"; sourceTree = ""; }; - E2639B2E190D1AE200B6251A /* wooden-crate.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "wooden-crate.jpg"; sourceTree = ""; }; - E2639B30190D1AE200B6251A /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - E2639B32190D1AE200B6251A /* Bitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bitmap.cpp; sourceTree = ""; }; - E2639B33190D1AE200B6251A /* Bitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bitmap.h; sourceTree = ""; }; - E2639B34190D1AE200B6251A /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = ""; }; - E2639B35190D1AE200B6251A /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = ""; }; - E2639B36190D1AE200B6251A /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; - E2639B37190D1AE200B6251A /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; - E2639B38190D1AE200B6251A /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; }; - E2639B39190D1AE200B6251A /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; }; - E2639B50190D1B5300B6251A /* fragment-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "fragment-shader.txt"; sourceTree = ""; }; - E2639B51190D1B5300B6251A /* vertex-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "vertex-shader.txt"; sourceTree = ""; }; - E2639B52190D1B5300B6251A /* wooden-crate.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "wooden-crate.jpg"; sourceTree = ""; }; - E2639B54190D1B5300B6251A /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - E2639B56190D1B5300B6251A /* Bitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bitmap.cpp; sourceTree = ""; }; - E2639B57190D1B5300B6251A /* Bitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bitmap.h; sourceTree = ""; }; - E2639B58190D1B5300B6251A /* Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Camera.cpp; sourceTree = ""; }; - E2639B59190D1B5300B6251A /* Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Camera.h; sourceTree = ""; }; - E2639B5A190D1B5300B6251A /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = ""; }; - E2639B5B190D1B5300B6251A /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = ""; }; - E2639B5C190D1B5300B6251A /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; - E2639B5D190D1B5300B6251A /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; - E2639B5E190D1B5300B6251A /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; }; - E2639B5F190D1B5300B6251A /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; }; - E2639B6B190D1B8F00B6251A /* fragment-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "fragment-shader.txt"; sourceTree = ""; }; - E2639B6C190D1B8F00B6251A /* vertex-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "vertex-shader.txt"; sourceTree = ""; }; - E2639B6D190D1B8F00B6251A /* wooden-crate.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "wooden-crate.jpg"; sourceTree = ""; }; - E2639B6F190D1B8F00B6251A /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - E2639B71190D1B8F00B6251A /* Bitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bitmap.cpp; sourceTree = ""; }; - E2639B72190D1B8F00B6251A /* Bitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bitmap.h; sourceTree = ""; }; - E2639B73190D1B8F00B6251A /* Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Camera.cpp; sourceTree = ""; }; - E2639B74190D1B8F00B6251A /* Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Camera.h; sourceTree = ""; }; - E2639B75190D1B8F00B6251A /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = ""; }; - E2639B76190D1B8F00B6251A /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = ""; }; - E2639B77190D1B8F00B6251A /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; - E2639B78190D1B8F00B6251A /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; - E2639B79190D1B8F00B6251A /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; }; - E2639B7A190D1B8F00B6251A /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; }; - E2639B86190D1BC000B6251A /* fragment-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "fragment-shader.txt"; sourceTree = ""; }; - E2639B87190D1BC000B6251A /* vertex-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "vertex-shader.txt"; sourceTree = ""; }; - E2639B88190D1BC000B6251A /* wooden-crate.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "wooden-crate.jpg"; sourceTree = ""; }; - E2639B8A190D1BC000B6251A /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - E2639B8C190D1BC000B6251A /* Bitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bitmap.cpp; sourceTree = ""; }; - E2639B8D190D1BC000B6251A /* Bitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bitmap.h; sourceTree = ""; }; - E2639B8E190D1BC000B6251A /* Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Camera.cpp; sourceTree = ""; }; - E2639B8F190D1BC000B6251A /* Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Camera.h; sourceTree = ""; }; - E2639B90190D1BC000B6251A /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = ""; }; - E2639B91190D1BC000B6251A /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = ""; }; - E2639B92190D1BC000B6251A /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; - E2639B93190D1BC000B6251A /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; - E2639B94190D1BC000B6251A /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; }; - E2639B95190D1BC000B6251A /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; }; - E2639BA1190D1BEC00B6251A /* fragment-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "fragment-shader.txt"; sourceTree = ""; }; - E2639BA2190D1BEC00B6251A /* vertex-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "vertex-shader.txt"; sourceTree = ""; }; - E2639BA3190D1BEC00B6251A /* wooden-crate.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "wooden-crate.jpg"; sourceTree = ""; }; - E2639BA5190D1BEC00B6251A /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - E2639BA7190D1BEC00B6251A /* Bitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bitmap.cpp; sourceTree = ""; }; - E2639BA8190D1BEC00B6251A /* Bitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bitmap.h; sourceTree = ""; }; - E2639BA9190D1BEC00B6251A /* Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Camera.cpp; sourceTree = ""; }; - E2639BAA190D1BEC00B6251A /* Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Camera.h; sourceTree = ""; }; - E2639BAB190D1BEC00B6251A /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = ""; }; - E2639BAC190D1BEC00B6251A /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = ""; }; - E2639BAD190D1BEC00B6251A /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; - E2639BAE190D1BEC00B6251A /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; - E2639BAF190D1BEC00B6251A /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; }; - E2639BB0190D1BEC00B6251A /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; }; - E2639BBC190D1C1700B6251A /* fragment-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "fragment-shader.txt"; sourceTree = ""; }; - E2639BBD190D1C1700B6251A /* vertex-shader.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "vertex-shader.txt"; sourceTree = ""; }; - E2639BBE190D1C1700B6251A /* wooden-crate.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "wooden-crate.jpg"; sourceTree = ""; }; - E2639BC0190D1C1700B6251A /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - E2639BC2190D1C1700B6251A /* Bitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bitmap.cpp; sourceTree = ""; }; - E2639BC3190D1C1700B6251A /* Bitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bitmap.h; sourceTree = ""; }; - E2639BC4190D1C1700B6251A /* Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Camera.cpp; sourceTree = ""; }; - E2639BC5190D1C1700B6251A /* Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Camera.h; sourceTree = ""; }; - E2639BC6190D1C1700B6251A /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = ""; }; - E2639BC7190D1C1700B6251A /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = ""; }; - E2639BC8190D1C1700B6251A /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; - E2639BC9190D1C1700B6251A /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; - E2639BCA190D1C1700B6251A /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; }; - E2639BCB190D1C1700B6251A /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; }; - E29C2A8C19FB7AA500A6FCD2 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - E29C2AC619FCA19100A6FCD2 /* platform.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = platform.hpp; path = source/common/platform.hpp; sourceTree = ""; }; - E29C2AC719FCA1A100A6FCD2 /* libglfw3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libglfw3.a; path = platforms/osx/libglfw3.a; sourceTree = ""; }; - E29C2AC819FCA1A100A6FCD2 /* platform_osx.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = platform_osx.mm; path = platforms/osx/platform_osx.mm; sourceTree = ""; }; - E29C2AC919FCA1C400A6FCD2 /* glew.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = glew.c; path = source/common/thirdparty/glew/src/glew.c; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - E263994A190D148400B6251A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E29C2A8E19FB7AAD00A6FCD2 /* QuartzCore.framework in Frameworks */, - E29C2AD219FCA21900A6FCD2 /* libglfw3.a in Frameworks */, - E2639AFC190D16FF00B6251A /* IOKit.framework in Frameworks */, - E2639AE8190D169200B6251A /* OpenGL.framework in Frameworks */, - E2639951190D148400B6251A /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639983190D149C00B6251A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E29C2A8F19FB7AAE00A6FCD2 /* QuartzCore.framework in Frameworks */, - E29C2AD319FCA21C00A6FCD2 /* libglfw3.a in Frameworks */, - E2639B29190D18E600B6251A /* IOKit.framework in Frameworks */, - E2639B28190D18DF00B6251A /* OpenGL.framework in Frameworks */, - E2639987190D149C00B6251A /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E26399B4190D14B200B6251A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E29C2A9019FB7AAF00A6FCD2 /* QuartzCore.framework in Frameworks */, - E29C2AD419FCA21C00A6FCD2 /* libglfw3.a in Frameworks */, - E26399B8190D14B200B6251A /* Cocoa.framework in Frameworks */, - E2639B42190D1B0300B6251A /* OpenGL.framework in Frameworks */, - E2639B48190D1B1400B6251A /* IOKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E26399E5190D14C000B6251A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E29C2A9119FB7AB000A6FCD2 /* QuartzCore.framework in Frameworks */, - E29C2AD519FCA21D00A6FCD2 /* libglfw3.a in Frameworks */, - E26399E9190D14C000B6251A /* Cocoa.framework in Frameworks */, - E2639B43190D1B0400B6251A /* OpenGL.framework in Frameworks */, - E2639B49190D1B1500B6251A /* IOKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639A16190D14D100B6251A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E29C2A9219FB7AB100A6FCD2 /* QuartzCore.framework in Frameworks */, - E29C2AD619FCA21E00A6FCD2 /* libglfw3.a in Frameworks */, - E2639A1A190D14D100B6251A /* Cocoa.framework in Frameworks */, - E2639B44190D1B0500B6251A /* OpenGL.framework in Frameworks */, - E2639B4A190D1B1500B6251A /* IOKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639A47190D14E600B6251A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E29C2A9319FB7AB100A6FCD2 /* QuartzCore.framework in Frameworks */, - E29C2AD719FCA21F00A6FCD2 /* libglfw3.a in Frameworks */, - E2639A4B190D14E600B6251A /* Cocoa.framework in Frameworks */, - E2639B45190D1B0600B6251A /* OpenGL.framework in Frameworks */, - E2639B4B190D1B1600B6251A /* IOKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639A78190D14F500B6251A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E29C2A9419FB7AB200A6FCD2 /* QuartzCore.framework in Frameworks */, - E29C2AD819FCA21F00A6FCD2 /* libglfw3.a in Frameworks */, - E2639A7C190D14F500B6251A /* Cocoa.framework in Frameworks */, - E2639B46190D1B0600B6251A /* OpenGL.framework in Frameworks */, - E2639B4C190D1B1700B6251A /* IOKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639AA9190D150700B6251A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E29C2A8D19FB7AA500A6FCD2 /* QuartzCore.framework in Frameworks */, - E29C2AD919FCA22100A6FCD2 /* libglfw3.a in Frameworks */, - E2639AAD190D150700B6251A /* Cocoa.framework in Frameworks */, - E2639B47190D1B0700B6251A /* OpenGL.framework in Frameworks */, - E2639B4D190D1B1700B6251A /* IOKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - E2639942190D145C00B6251A = { - isa = PBXGroup; - children = ( - E2639AD9190D156500B6251A /* 01_project_skeleton */, - E2639B10190D179B00B6251A /* 02_textures */, - E2639B2A190D1AE200B6251A /* 03_matrices */, - E2639B4E190D1B5300B6251A /* 04_camera */, - E2639B69190D1B8F00B6251A /* 05_asset_instance */, - E2639B84190D1BC000B6251A /* 06_diffuse_lighting */, - E2639B9F190D1BEC00B6251A /* 07_more_lighting */, - E2639BBA190D1C1700B6251A /* 08_even_more_lighting */, - E29C2AA019FC9ADC00A6FCD2 /* common */, - E263994E190D148400B6251A /* Products */, - ); - sourceTree = ""; - }; - E263994E190D148400B6251A /* Products */ = { - isa = PBXGroup; - children = ( - E263994D190D148400B6251A /* 01_project_skeleton.app */, - E2639986190D149C00B6251A /* 02_textures.app */, - E26399B7190D14B200B6251A /* 03_matrices.app */, - E26399E8190D14C000B6251A /* 04_camera.app */, - E2639A19190D14D100B6251A /* 05_asset_instance.app */, - E2639A4A190D14E600B6251A /* 06_diffuse_lighting.app */, - E2639A7B190D14F500B6251A /* 07_more_lighting.app */, - E2639AAC190D150700B6251A /* 08_even_more_lighting.app */, - ); - name = Products; - sourceTree = ""; - }; - E2639AD9190D156500B6251A /* 01_project_skeleton */ = { - isa = PBXGroup; - children = ( - E2639ADA190D156500B6251A /* source */, - E2639AFD190D174200B6251A /* resources */, - ); - name = 01_project_skeleton; - path = source/01_project_skeleton; - sourceTree = ""; - }; - E2639ADA190D156500B6251A /* source */ = { - isa = PBXGroup; - children = ( - E2639ADC190D156500B6251A /* main.cpp */, - E2639ADD190D156500B6251A /* Program.cpp */, - E2639ADE190D156500B6251A /* Program.h */, - E2639ADF190D156500B6251A /* Shader.cpp */, - E2639AE0190D156500B6251A /* Shader.h */, - ); - path = source; - sourceTree = ""; - }; - E2639AFD190D174200B6251A /* resources */ = { - isa = PBXGroup; - children = ( - E2639AFE190D174200B6251A /* fragment-shader.txt */, - E2639AFF190D174200B6251A /* vertex-shader.txt */, - ); - path = resources; - sourceTree = ""; - }; - E2639B10190D179B00B6251A /* 02_textures */ = { - isa = PBXGroup; - children = ( - E2639B11190D179B00B6251A /* resources */, - E2639B15190D179B00B6251A /* source */, - ); - name = 02_textures; - path = source/02_textures; - sourceTree = ""; - }; - E2639B11190D179B00B6251A /* resources */ = { - isa = PBXGroup; - children = ( - E2639B12190D179B00B6251A /* fragment-shader.txt */, - E2639B13190D179B00B6251A /* hazard.png */, - E2639B14190D179B00B6251A /* vertex-shader.txt */, - ); - path = resources; - sourceTree = ""; - }; - E2639B15190D179B00B6251A /* source */ = { - isa = PBXGroup; - children = ( - E2639B16190D179B00B6251A /* main.cpp */, - E2639B17190D179B00B6251A /* tdogl */, - ); - path = source; - sourceTree = ""; - }; - E2639B17190D179B00B6251A /* tdogl */ = { - isa = PBXGroup; - children = ( - E2639B18190D179B00B6251A /* Bitmap.cpp */, - E2639B19190D179B00B6251A /* Bitmap.h */, - E2639B1A190D179B00B6251A /* Program.cpp */, - E2639B1B190D179B00B6251A /* Program.h */, - E2639B1C190D179B00B6251A /* Shader.cpp */, - E2639B1D190D179B00B6251A /* Shader.h */, - E2639B1E190D179B00B6251A /* Texture.cpp */, - E2639B1F190D179B00B6251A /* Texture.h */, - ); - path = tdogl; - sourceTree = ""; - }; - E2639B2A190D1AE200B6251A /* 03_matrices */ = { - isa = PBXGroup; - children = ( - E2639B2B190D1AE200B6251A /* resources */, - E2639B2F190D1AE200B6251A /* source */, - ); - name = 03_matrices; - path = source/03_matrices; - sourceTree = ""; - }; - E2639B2B190D1AE200B6251A /* resources */ = { - isa = PBXGroup; - children = ( - E2639B2C190D1AE200B6251A /* fragment-shader.txt */, - E2639B2D190D1AE200B6251A /* vertex-shader.txt */, - E2639B2E190D1AE200B6251A /* wooden-crate.jpg */, - ); - path = resources; - sourceTree = ""; - }; - E2639B2F190D1AE200B6251A /* source */ = { - isa = PBXGroup; - children = ( - E2639B30190D1AE200B6251A /* main.cpp */, - E2639B31190D1AE200B6251A /* tdogl */, - ); - path = source; - sourceTree = ""; - }; - E2639B31190D1AE200B6251A /* tdogl */ = { - isa = PBXGroup; - children = ( - E2639B32190D1AE200B6251A /* Bitmap.cpp */, - E2639B33190D1AE200B6251A /* Bitmap.h */, - E2639B34190D1AE200B6251A /* Program.cpp */, - E2639B35190D1AE200B6251A /* Program.h */, - E2639B36190D1AE200B6251A /* Shader.cpp */, - E2639B37190D1AE200B6251A /* Shader.h */, - E2639B38190D1AE200B6251A /* Texture.cpp */, - E2639B39190D1AE200B6251A /* Texture.h */, - ); - path = tdogl; - sourceTree = ""; - }; - E2639B4E190D1B5300B6251A /* 04_camera */ = { - isa = PBXGroup; - children = ( - E2639B4F190D1B5300B6251A /* resources */, - E2639B53190D1B5300B6251A /* source */, - ); - name = 04_camera; - path = source/04_camera; - sourceTree = ""; - }; - E2639B4F190D1B5300B6251A /* resources */ = { - isa = PBXGroup; - children = ( - E2639B50190D1B5300B6251A /* fragment-shader.txt */, - E2639B51190D1B5300B6251A /* vertex-shader.txt */, - E2639B52190D1B5300B6251A /* wooden-crate.jpg */, - ); - path = resources; - sourceTree = ""; - }; - E2639B53190D1B5300B6251A /* source */ = { - isa = PBXGroup; - children = ( - E2639B54190D1B5300B6251A /* main.cpp */, - E2639B55190D1B5300B6251A /* tdogl */, - ); - path = source; - sourceTree = ""; - }; - E2639B55190D1B5300B6251A /* tdogl */ = { - isa = PBXGroup; - children = ( - E2639B56190D1B5300B6251A /* Bitmap.cpp */, - E2639B57190D1B5300B6251A /* Bitmap.h */, - E2639B58190D1B5300B6251A /* Camera.cpp */, - E2639B59190D1B5300B6251A /* Camera.h */, - E2639B5A190D1B5300B6251A /* Program.cpp */, - E2639B5B190D1B5300B6251A /* Program.h */, - E2639B5C190D1B5300B6251A /* Shader.cpp */, - E2639B5D190D1B5300B6251A /* Shader.h */, - E2639B5E190D1B5300B6251A /* Texture.cpp */, - E2639B5F190D1B5300B6251A /* Texture.h */, - ); - path = tdogl; - sourceTree = ""; - }; - E2639B69190D1B8F00B6251A /* 05_asset_instance */ = { - isa = PBXGroup; - children = ( - E2639B6A190D1B8F00B6251A /* resources */, - E2639B6E190D1B8F00B6251A /* source */, - ); - name = 05_asset_instance; - path = source/05_asset_instance; - sourceTree = ""; - }; - E2639B6A190D1B8F00B6251A /* resources */ = { - isa = PBXGroup; - children = ( - E2639B6B190D1B8F00B6251A /* fragment-shader.txt */, - E2639B6C190D1B8F00B6251A /* vertex-shader.txt */, - E2639B6D190D1B8F00B6251A /* wooden-crate.jpg */, - ); - path = resources; - sourceTree = ""; - }; - E2639B6E190D1B8F00B6251A /* source */ = { - isa = PBXGroup; - children = ( - E2639B6F190D1B8F00B6251A /* main.cpp */, - E2639B70190D1B8F00B6251A /* tdogl */, - ); - path = source; - sourceTree = ""; - }; - E2639B70190D1B8F00B6251A /* tdogl */ = { - isa = PBXGroup; - children = ( - E2639B71190D1B8F00B6251A /* Bitmap.cpp */, - E2639B72190D1B8F00B6251A /* Bitmap.h */, - E2639B73190D1B8F00B6251A /* Camera.cpp */, - E2639B74190D1B8F00B6251A /* Camera.h */, - E2639B75190D1B8F00B6251A /* Program.cpp */, - E2639B76190D1B8F00B6251A /* Program.h */, - E2639B77190D1B8F00B6251A /* Shader.cpp */, - E2639B78190D1B8F00B6251A /* Shader.h */, - E2639B79190D1B8F00B6251A /* Texture.cpp */, - E2639B7A190D1B8F00B6251A /* Texture.h */, - ); - path = tdogl; - sourceTree = ""; - }; - E2639B84190D1BC000B6251A /* 06_diffuse_lighting */ = { - isa = PBXGroup; - children = ( - E2639B85190D1BC000B6251A /* resources */, - E2639B89190D1BC000B6251A /* source */, - ); - name = 06_diffuse_lighting; - path = source/06_diffuse_lighting; - sourceTree = ""; - }; - E2639B85190D1BC000B6251A /* resources */ = { - isa = PBXGroup; - children = ( - E2639B86190D1BC000B6251A /* fragment-shader.txt */, - E2639B87190D1BC000B6251A /* vertex-shader.txt */, - E2639B88190D1BC000B6251A /* wooden-crate.jpg */, - ); - path = resources; - sourceTree = ""; - }; - E2639B89190D1BC000B6251A /* source */ = { - isa = PBXGroup; - children = ( - E2639B8A190D1BC000B6251A /* main.cpp */, - E2639B8B190D1BC000B6251A /* tdogl */, - ); - path = source; - sourceTree = ""; - }; - E2639B8B190D1BC000B6251A /* tdogl */ = { - isa = PBXGroup; - children = ( - E2639B8C190D1BC000B6251A /* Bitmap.cpp */, - E2639B8D190D1BC000B6251A /* Bitmap.h */, - E2639B8E190D1BC000B6251A /* Camera.cpp */, - E2639B8F190D1BC000B6251A /* Camera.h */, - E2639B90190D1BC000B6251A /* Program.cpp */, - E2639B91190D1BC000B6251A /* Program.h */, - E2639B92190D1BC000B6251A /* Shader.cpp */, - E2639B93190D1BC000B6251A /* Shader.h */, - E2639B94190D1BC000B6251A /* Texture.cpp */, - E2639B95190D1BC000B6251A /* Texture.h */, - ); - path = tdogl; - sourceTree = ""; - }; - E2639B9F190D1BEC00B6251A /* 07_more_lighting */ = { - isa = PBXGroup; - children = ( - E2639BA0190D1BEC00B6251A /* resources */, - E2639BA4190D1BEC00B6251A /* source */, - ); - name = 07_more_lighting; - path = source/07_more_lighting; - sourceTree = ""; - }; - E2639BA0190D1BEC00B6251A /* resources */ = { - isa = PBXGroup; - children = ( - E2639BA1190D1BEC00B6251A /* fragment-shader.txt */, - E2639BA2190D1BEC00B6251A /* vertex-shader.txt */, - E2639BA3190D1BEC00B6251A /* wooden-crate.jpg */, - ); - path = resources; - sourceTree = ""; - }; - E2639BA4190D1BEC00B6251A /* source */ = { - isa = PBXGroup; - children = ( - E2639BA5190D1BEC00B6251A /* main.cpp */, - E2639BA6190D1BEC00B6251A /* tdogl */, - ); - path = source; - sourceTree = ""; - }; - E2639BA6190D1BEC00B6251A /* tdogl */ = { - isa = PBXGroup; - children = ( - E2639BA7190D1BEC00B6251A /* Bitmap.cpp */, - E2639BA8190D1BEC00B6251A /* Bitmap.h */, - E2639BA9190D1BEC00B6251A /* Camera.cpp */, - E2639BAA190D1BEC00B6251A /* Camera.h */, - E2639BAB190D1BEC00B6251A /* Program.cpp */, - E2639BAC190D1BEC00B6251A /* Program.h */, - E2639BAD190D1BEC00B6251A /* Shader.cpp */, - E2639BAE190D1BEC00B6251A /* Shader.h */, - E2639BAF190D1BEC00B6251A /* Texture.cpp */, - E2639BB0190D1BEC00B6251A /* Texture.h */, - ); - path = tdogl; - sourceTree = ""; - }; - E2639BBA190D1C1700B6251A /* 08_even_more_lighting */ = { - isa = PBXGroup; - children = ( - E2639BBB190D1C1700B6251A /* resources */, - E2639BBF190D1C1700B6251A /* source */, - ); - name = 08_even_more_lighting; - path = source/08_even_more_lighting; - sourceTree = ""; - }; - E2639BBB190D1C1700B6251A /* resources */ = { - isa = PBXGroup; - children = ( - E2639BBC190D1C1700B6251A /* fragment-shader.txt */, - E2639BBD190D1C1700B6251A /* vertex-shader.txt */, - E2639BBE190D1C1700B6251A /* wooden-crate.jpg */, - ); - path = resources; - sourceTree = ""; - }; - E2639BBF190D1C1700B6251A /* source */ = { - isa = PBXGroup; - children = ( - E2639BC0190D1C1700B6251A /* main.cpp */, - E2639BC1190D1C1700B6251A /* tdogl */, - ); - path = source; - sourceTree = ""; - }; - E2639BC1190D1C1700B6251A /* tdogl */ = { - isa = PBXGroup; - children = ( - E2639BC2190D1C1700B6251A /* Bitmap.cpp */, - E2639BC3190D1C1700B6251A /* Bitmap.h */, - E2639BC4190D1C1700B6251A /* Camera.cpp */, - E2639BC5190D1C1700B6251A /* Camera.h */, - E2639BC6190D1C1700B6251A /* Program.cpp */, - E2639BC7190D1C1700B6251A /* Program.h */, - E2639BC8190D1C1700B6251A /* Shader.cpp */, - E2639BC9190D1C1700B6251A /* Shader.h */, - E2639BCA190D1C1700B6251A /* Texture.cpp */, - E2639BCB190D1C1700B6251A /* Texture.h */, - ); - path = tdogl; - sourceTree = ""; - }; - E29C2AA019FC9ADC00A6FCD2 /* common */ = { - isa = PBXGroup; - children = ( - E29C2AC619FCA19100A6FCD2 /* platform.hpp */, - E29C2AC719FCA1A100A6FCD2 /* libglfw3.a */, - E29C2AC819FCA1A100A6FCD2 /* platform_osx.mm */, - E29C2AC919FCA1C400A6FCD2 /* glew.c */, - E29C2A8C19FB7AA500A6FCD2 /* QuartzCore.framework */, - E2639AE7190D169200B6251A /* OpenGL.framework */, - E2639950190D148400B6251A /* Cocoa.framework */, - E2639AFB190D16FF00B6251A /* IOKit.framework */, - ); - name = common; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - E263994C190D148400B6251A /* 01_project_skeleton */ = { - isa = PBXNativeTarget; - buildConfigurationList = E263997C190D148500B6251A /* Build configuration list for PBXNativeTarget "01_project_skeleton" */; - buildPhases = ( - E2639949190D148400B6251A /* Sources */, - E263994A190D148400B6251A /* Frameworks */, - E263994B190D148400B6251A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 01_project_skeleton; - productName = 01_project_skeleton; - productReference = E263994D190D148400B6251A /* 01_project_skeleton.app */; - productType = "com.apple.product-type.application"; - }; - E2639985190D149C00B6251A /* 02_textures */ = { - isa = PBXNativeTarget; - buildConfigurationList = E26399AD190D149C00B6251A /* Build configuration list for PBXNativeTarget "02_textures" */; - buildPhases = ( - E2639982190D149C00B6251A /* Sources */, - E2639983190D149C00B6251A /* Frameworks */, - E2639984190D149C00B6251A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 02_textures; - productName = 02_textures; - productReference = E2639986190D149C00B6251A /* 02_textures.app */; - productType = "com.apple.product-type.application"; - }; - E26399B6190D14B200B6251A /* 03_matrices */ = { - isa = PBXNativeTarget; - buildConfigurationList = E26399DE190D14B300B6251A /* Build configuration list for PBXNativeTarget "03_matrices" */; - buildPhases = ( - E26399B3190D14B200B6251A /* Sources */, - E26399B4190D14B200B6251A /* Frameworks */, - E26399B5190D14B200B6251A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 03_matrices; - productName = 03_matrices; - productReference = E26399B7190D14B200B6251A /* 03_matrices.app */; - productType = "com.apple.product-type.application"; - }; - E26399E7190D14C000B6251A /* 04_camera */ = { - isa = PBXNativeTarget; - buildConfigurationList = E2639A0F190D14C100B6251A /* Build configuration list for PBXNativeTarget "04_camera" */; - buildPhases = ( - E26399E4190D14C000B6251A /* Sources */, - E26399E5190D14C000B6251A /* Frameworks */, - E26399E6190D14C000B6251A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 04_camera; - productName = 04_camera; - productReference = E26399E8190D14C000B6251A /* 04_camera.app */; - productType = "com.apple.product-type.application"; - }; - E2639A18190D14D100B6251A /* 05_asset_instance */ = { - isa = PBXNativeTarget; - buildConfigurationList = E2639A40190D14D100B6251A /* Build configuration list for PBXNativeTarget "05_asset_instance" */; - buildPhases = ( - E2639A15190D14D100B6251A /* Sources */, - E2639A16190D14D100B6251A /* Frameworks */, - E2639A17190D14D100B6251A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 05_asset_instance; - productName = 05_asset_instance; - productReference = E2639A19190D14D100B6251A /* 05_asset_instance.app */; - productType = "com.apple.product-type.application"; - }; - E2639A49190D14E600B6251A /* 06_diffuse_lighting */ = { - isa = PBXNativeTarget; - buildConfigurationList = E2639A71190D14E600B6251A /* Build configuration list for PBXNativeTarget "06_diffuse_lighting" */; - buildPhases = ( - E2639A46190D14E600B6251A /* Sources */, - E2639A47190D14E600B6251A /* Frameworks */, - E2639A48190D14E600B6251A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 06_diffuse_lighting; - productName = 06_diffuse_lighting; - productReference = E2639A4A190D14E600B6251A /* 06_diffuse_lighting.app */; - productType = "com.apple.product-type.application"; - }; - E2639A7A190D14F500B6251A /* 07_more_lighting */ = { - isa = PBXNativeTarget; - buildConfigurationList = E2639AA2190D14F600B6251A /* Build configuration list for PBXNativeTarget "07_more_lighting" */; - buildPhases = ( - E2639A77190D14F500B6251A /* Sources */, - E2639A78190D14F500B6251A /* Frameworks */, - E2639A79190D14F500B6251A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 07_more_lighting; - productName = 07_more_lighting; - productReference = E2639A7B190D14F500B6251A /* 07_more_lighting.app */; - productType = "com.apple.product-type.application"; - }; - E2639AAB190D150700B6251A /* 08_even_more_lighting */ = { - isa = PBXNativeTarget; - buildConfigurationList = E2639AD3190D150700B6251A /* Build configuration list for PBXNativeTarget "08_even_more_lighting" */; - buildPhases = ( - E2639AA8190D150700B6251A /* Sources */, - E2639AA9190D150700B6251A /* Frameworks */, - E2639AAA190D150700B6251A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 08_even_more_lighting; - productName = 08_even_more_lighting; - productReference = E2639AAC190D150700B6251A /* 08_even_more_lighting.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E2639943190D145C00B6251A /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0610; - }; - buildConfigurationList = E2639946190D145C00B6251A /* Build configuration list for PBXProject "opengl-series" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = E2639942190D145C00B6251A; - productRefGroup = E263994E190D148400B6251A /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - E263994C190D148400B6251A /* 01_project_skeleton */, - E2639985190D149C00B6251A /* 02_textures */, - E26399B6190D14B200B6251A /* 03_matrices */, - E26399E7190D14C000B6251A /* 04_camera */, - E2639A18190D14D100B6251A /* 05_asset_instance */, - E2639A49190D14E600B6251A /* 06_diffuse_lighting */, - E2639A7A190D14F500B6251A /* 07_more_lighting */, - E2639AAB190D150700B6251A /* 08_even_more_lighting */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - E263994B190D148400B6251A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B08190D174200B6251A /* vertex-shader.txt in Resources */, - E2639B00190D174200B6251A /* fragment-shader.txt in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639984190D149C00B6251A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B22190D179B00B6251A /* vertex-shader.txt in Resources */, - E2639B20190D179B00B6251A /* fragment-shader.txt in Resources */, - E2639B21190D179B00B6251A /* hazard.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E26399B5190D14B200B6251A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B3A190D1AE200B6251A /* fragment-shader.txt in Resources */, - E2639B3C190D1AE200B6251A /* wooden-crate.jpg in Resources */, - E2639B3B190D1AE200B6251A /* vertex-shader.txt in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E26399E6190D14C000B6251A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B60190D1B5300B6251A /* fragment-shader.txt in Resources */, - E2639B62190D1B5300B6251A /* wooden-crate.jpg in Resources */, - E2639B61190D1B5300B6251A /* vertex-shader.txt in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639A17190D14D100B6251A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B7B190D1B8F00B6251A /* fragment-shader.txt in Resources */, - E2639B7D190D1B8F00B6251A /* wooden-crate.jpg in Resources */, - E2639B7C190D1B8F00B6251A /* vertex-shader.txt in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639A48190D14E600B6251A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B96190D1BC000B6251A /* fragment-shader.txt in Resources */, - E2639B98190D1BC100B6251A /* wooden-crate.jpg in Resources */, - E2639B97190D1BC100B6251A /* vertex-shader.txt in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639A79190D14F500B6251A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639BB1190D1BEC00B6251A /* fragment-shader.txt in Resources */, - E2639BB3190D1BEC00B6251A /* wooden-crate.jpg in Resources */, - E2639BB2190D1BEC00B6251A /* vertex-shader.txt in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639AAA190D150700B6251A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639BCC190D1C1700B6251A /* fragment-shader.txt in Resources */, - E2639BCE190D1C1700B6251A /* wooden-crate.jpg in Resources */, - E2639BCD190D1C1700B6251A /* vertex-shader.txt in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - E2639949190D148400B6251A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E29C2ACA19FCA1C400A6FCD2 /* glew.c in Sources */, - E2639AE4190D156500B6251A /* Program.cpp in Sources */, - E2639AE5190D156500B6251A /* Shader.cpp in Sources */, - E2639AE3190D156500B6251A /* main.cpp in Sources */, - E29C2ADA19FCA22D00A6FCD2 /* platform_osx.mm in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639982190D149C00B6251A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B25190D179B00B6251A /* Program.cpp in Sources */, - E2639B23190D179B00B6251A /* main.cpp in Sources */, - E29C2ACB19FCA1C400A6FCD2 /* glew.c in Sources */, - E29C2ADB19FCA22E00A6FCD2 /* platform_osx.mm in Sources */, - E2639B27190D179B00B6251A /* Texture.cpp in Sources */, - E2639B24190D179B00B6251A /* Bitmap.cpp in Sources */, - E2639B26190D179B00B6251A /* Shader.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E26399B3190D14B200B6251A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B3F190D1AE200B6251A /* Program.cpp in Sources */, - E2639B3D190D1AE200B6251A /* main.cpp in Sources */, - E29C2ACC19FCA1C400A6FCD2 /* glew.c in Sources */, - E29C2ADC19FCA22F00A6FCD2 /* platform_osx.mm in Sources */, - E2639B41190D1AE200B6251A /* Texture.cpp in Sources */, - E2639B3E190D1AE200B6251A /* Bitmap.cpp in Sources */, - E2639B40190D1AE200B6251A /* Shader.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E26399E4190D14C000B6251A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B66190D1B5300B6251A /* Program.cpp in Sources */, - E2639B68190D1B5300B6251A /* Texture.cpp in Sources */, - E2639B65190D1B5300B6251A /* Camera.cpp in Sources */, - E2639B63190D1B5300B6251A /* main.cpp in Sources */, - E2639B67190D1B5300B6251A /* Shader.cpp in Sources */, - E29C2ADD19FCA22F00A6FCD2 /* platform_osx.mm in Sources */, - E29C2ACD19FCA1C400A6FCD2 /* glew.c in Sources */, - E2639B64190D1B5300B6251A /* Bitmap.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639A15190D14D100B6251A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B81190D1B8F00B6251A /* Program.cpp in Sources */, - E2639B83190D1B8F00B6251A /* Texture.cpp in Sources */, - E2639B80190D1B8F00B6251A /* Camera.cpp in Sources */, - E2639B7E190D1B8F00B6251A /* main.cpp in Sources */, - E2639B82190D1B8F00B6251A /* Shader.cpp in Sources */, - E29C2ADE19FCA23000A6FCD2 /* platform_osx.mm in Sources */, - E29C2ACE19FCA1C400A6FCD2 /* glew.c in Sources */, - E2639B7F190D1B8F00B6251A /* Bitmap.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639A46190D14E600B6251A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639B9C190D1BC100B6251A /* Program.cpp in Sources */, - E2639B9E190D1BC100B6251A /* Texture.cpp in Sources */, - E2639B9B190D1BC100B6251A /* Camera.cpp in Sources */, - E2639B99190D1BC100B6251A /* main.cpp in Sources */, - E2639B9D190D1BC100B6251A /* Shader.cpp in Sources */, - E29C2ADF19FCA23100A6FCD2 /* platform_osx.mm in Sources */, - E29C2ACF19FCA1C400A6FCD2 /* glew.c in Sources */, - E2639B9A190D1BC100B6251A /* Bitmap.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639A77190D14F500B6251A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639BB7190D1BEC00B6251A /* Program.cpp in Sources */, - E2639BB9190D1BEC00B6251A /* Texture.cpp in Sources */, - E2639BB6190D1BEC00B6251A /* Camera.cpp in Sources */, - E2639BB4190D1BEC00B6251A /* main.cpp in Sources */, - E2639BB8190D1BEC00B6251A /* Shader.cpp in Sources */, - E29C2AE019FCA23100A6FCD2 /* platform_osx.mm in Sources */, - E29C2AD019FCA1C400A6FCD2 /* glew.c in Sources */, - E2639BB5190D1BEC00B6251A /* Bitmap.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2639AA8190D150700B6251A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E2639BD2190D1C1700B6251A /* Program.cpp in Sources */, - E2639BD4190D1C1700B6251A /* Texture.cpp in Sources */, - E2639BD1190D1C1700B6251A /* Camera.cpp in Sources */, - E2639BCF190D1C1700B6251A /* main.cpp in Sources */, - E2639BD3190D1C1700B6251A /* Shader.cpp in Sources */, - E29C2AE119FCA23200A6FCD2 /* platform_osx.mm in Sources */, - E29C2AD119FCA1C400A6FCD2 /* glew.c in Sources */, - E2639BD0190D1C1700B6251A /* Bitmap.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - E2639947190D145D00B6251A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - GLM_FORCE_RADIANS, - ); - GCC_WARN_PEDANTIC = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "\"$(PROJECT_DIR)/source/common/thirdparty\"/**", - ); - LIBRARY_SEARCH_PATHS = "\"$(PROJECT_DIR)/platforms/osx\""; - MACOSX_DEPLOYMENT_TARGET = 10.9; - ONLY_ACTIVE_ARCH = YES; - }; - name = Debug; - }; - E2639948190D145D00B6251A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - GLM_FORCE_RADIANS, - ); - GCC_WARN_PEDANTIC = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "\"$(PROJECT_DIR)/source/common/thirdparty\"/**", - ); - LIBRARY_SEARCH_PATHS = "\"$(PROJECT_DIR)/platforms/osx\""; - MACOSX_DEPLOYMENT_TARGET = 10.9; - }; - name = Release; - }; - E263997D190D148500B6251A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 01_project_skeleton; - }; - name = Debug; - }; - E263997E190D148500B6251A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 01_project_skeleton; - }; - name = Release; - }; - E26399AE190D149C00B6251A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 02_textures; - }; - name = Debug; - }; - E26399AF190D149C00B6251A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 02_textures; - }; - name = Release; - }; - E26399DF190D14B300B6251A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 03_matrices; - }; - name = Debug; - }; - E26399E0190D14B300B6251A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 03_matrices; - }; - name = Release; - }; - E2639A10190D14C100B6251A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 04_camera; - }; - name = Debug; - }; - E2639A11190D14C100B6251A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 04_camera; - }; - name = Release; - }; - E2639A41190D14D100B6251A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 05_asset_instance; - }; - name = Debug; - }; - E2639A42190D14D100B6251A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 05_asset_instance; - }; - name = Release; - }; - E2639A72190D14E600B6251A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 06_diffuse_lighting; - }; - name = Debug; - }; - E2639A73190D14E600B6251A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 06_diffuse_lighting; - }; - name = Release; - }; - E2639AA3190D14F600B6251A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 07_more_lighting; - }; - name = Debug; - }; - E2639AA4190D14F600B6251A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 07_more_lighting; - }; - name = Release; - }; - E2639AD4190D150700B6251A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 08_even_more_lighting; - }; - name = Debug; - }; - E2639AD5190D150700B6251A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/platforms/osx", - ); - PRODUCT_NAME = 08_even_more_lighting; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - E2639946190D145C00B6251A /* Build configuration list for PBXProject "opengl-series" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E2639947190D145D00B6251A /* Debug */, - E2639948190D145D00B6251A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E263997C190D148500B6251A /* Build configuration list for PBXNativeTarget "01_project_skeleton" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E263997D190D148500B6251A /* Debug */, - E263997E190D148500B6251A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E26399AD190D149C00B6251A /* Build configuration list for PBXNativeTarget "02_textures" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E26399AE190D149C00B6251A /* Debug */, - E26399AF190D149C00B6251A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E26399DE190D14B300B6251A /* Build configuration list for PBXNativeTarget "03_matrices" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E26399DF190D14B300B6251A /* Debug */, - E26399E0190D14B300B6251A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E2639A0F190D14C100B6251A /* Build configuration list for PBXNativeTarget "04_camera" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E2639A10190D14C100B6251A /* Debug */, - E2639A11190D14C100B6251A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E2639A40190D14D100B6251A /* Build configuration list for PBXNativeTarget "05_asset_instance" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E2639A41190D14D100B6251A /* Debug */, - E2639A42190D14D100B6251A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E2639A71190D14E600B6251A /* Build configuration list for PBXNativeTarget "06_diffuse_lighting" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E2639A72190D14E600B6251A /* Debug */, - E2639A73190D14E600B6251A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E2639AA2190D14F600B6251A /* Build configuration list for PBXNativeTarget "07_more_lighting" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E2639AA3190D14F600B6251A /* Debug */, - E2639AA4190D14F600B6251A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E2639AD3190D150700B6251A /* Build configuration list for PBXNativeTarget "08_even_more_lighting" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E2639AD4190D150700B6251A /* Debug */, - E2639AD5190D150700B6251A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = E2639943190D145C00B6251A /* Project object */; -} diff --git a/old/pixels.c b/old/pixels.c deleted file mode 100644 index a6a7a4d..0000000 --- a/old/pixels.c +++ /dev/null @@ -1,109 +0,0 @@ -#include -#include - -#define WIDTH 256 -#define HEIGHT 256 -#define PIXL 4 - -static GLubyte Image[WIDTH * HEIGHT * PIXL]; - - -static -GLboolean -ReadData() { - for (int i = 0; i < WIDTH * HEIGHT * PIXL; ++i) - Image[i] = 0; - - unsigned char previous = 0; - for (int i = 0; i < WIDTH * HEIGHT * PIXL; i += PIXL) { - unsigned char current = 0; - if (fread(¤t, 1, 1, stdin) == 1) { - if (0 == i) { - previous = current; - continue; - } - int idx = WIDTH * previous + current; - Image[idx + 0] = 1 + Image[idx + 0]; - Image[idx + 1] = 1 + Image[idx + 1]; - Image[idx + 2] = 1 + Image[idx + 2]; - Image[idx + 3] = 255; - previous = current; - } - else - return GL_FALSE; - } - return GL_TRUE; -} - - -static -void -Display(void) { - glClearColor(0, 0, 0, 1); - glClear(GL_COLOR_BUFFER_BIT); - - float zoom = 3.0; - glPixelZoom(zoom, zoom); - - if (GL_TRUE != ReadData()) { - perror("read"); - exit(0); - } - glDrawPixels(WIDTH, HEIGHT, GL_RGBA, GL_UNSIGNED_BYTE, Image); - /* glDrawPixels(WIDTH, HEIGHT, GL_LUMINANCE, GL_UNSIGNED_BYTE, Image); */ - - glutSwapBuffers(); -} - - -static -void -Reshape(int width, int height) { - glViewport(0, 0, width, height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0, width, 0.0, height, 0.0, 2.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); -} - - -static -void -Key(unsigned char key, int x, int y) { - (void) x; - (void) y; - switch (key) { - case 'q': - case 'Q': - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -int -main(int argc, char *argv[]) { - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE); - glutInitWindowSize(3 * WIDTH, 3 * HEIGHT); - glutCreateWindow(argv[0]); - - printf("GL_VERSION = %s\n", glGetString(GL_VERSION)); - printf("GL_RENDERER = %s\n", glGetString(GL_RENDERER)); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glPixelStorei(GL_UNPACK_ROW_LENGTH, WIDTH); - - printf("Keys:\n" - " ESC Q q Exit\n"); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Display); - - glutMainLoop(); - return 0; -} diff --git a/old/platforms/ios/04_camera/04_camera.xcodeproj/project.pbxproj b/old/platforms/ios/04_camera/04_camera.xcodeproj/project.pbxproj deleted file mode 100644 index 7d75611..0000000 --- a/old/platforms/ios/04_camera/04_camera.xcodeproj/project.pbxproj +++ /dev/null @@ -1,386 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1949ADDF16F5D20600287931 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1949ADDE16F5D20600287931 /* CoreMotion.framework */; }; - 1960665D16F57D3B008FFBDF /* iOS_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1960664D16F57D3B008FFBDF /* iOS_main.mm */; }; - 1960665E16F57D3B008FFBDF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1960664F16F57D3B008FFBDF /* main.m */; }; - 1960665F16F57D3B008FFBDF /* WLAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1960665116F57D3B008FFBDF /* WLAppDelegate.mm */; }; - 1960666016F57D3B008FFBDF /* WLViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1960665316F57D3B008FFBDF /* WLViewController.mm */; }; - 1960666116F57D3B008FFBDF /* Bitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1960665516F57D3B008FFBDF /* Bitmap.cpp */; }; - 1960666216F57D3B008FFBDF /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1960665716F57D3B008FFBDF /* Program.cpp */; }; - 1960666316F57D3B008FFBDF /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1960665916F57D3B008FFBDF /* Shader.cpp */; }; - 1960666416F57D3B008FFBDF /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1960665B16F57D3B008FFBDF /* Texture.cpp */; }; - 1960666D16F57D7B008FFBDF /* fragment-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = 1960666916F57D7B008FFBDF /* fragment-shader.txt */; }; - 1960666F16F57D7B008FFBDF /* vertex-shader.txt in Resources */ = {isa = PBXBuildFile; fileRef = 1960666B16F57D7B008FFBDF /* vertex-shader.txt */; }; - 1960667116F594A7008FFBDF /* wooden-crate.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1960667016F594A7008FFBDF /* wooden-crate.jpg */; }; - 1960667416F59A08008FFBDF /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1960667216F59A08008FFBDF /* Camera.cpp */; }; - 198F9C2216F5685900316EC8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 198F9C2116F5685900316EC8 /* UIKit.framework */; }; - 198F9C2416F5685900316EC8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 198F9C2316F5685900316EC8 /* Foundation.framework */; }; - 198F9C2616F5685900316EC8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 198F9C2516F5685900316EC8 /* CoreGraphics.framework */; }; - 198F9C2816F5685900316EC8 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 198F9C2716F5685900316EC8 /* GLKit.framework */; }; - 198F9C2A16F5685900316EC8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 198F9C2916F5685900316EC8 /* OpenGLES.framework */; }; - 198F9C6C16F569CC00316EC8 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 198F9C6016F569CC00316EC8 /* Default-568h@2x.png */; }; - 198F9C6D16F569CC00316EC8 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 198F9C6116F569CC00316EC8 /* Default.png */; }; - 198F9C6E16F569CC00316EC8 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 198F9C6216F569CC00316EC8 /* Default@2x.png */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 1949ADDE16F5D20600287931 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; - 1960664C16F57D3B008FFBDF /* iOS_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iOS_main.h; sourceTree = ""; }; - 1960664D16F57D3B008FFBDF /* iOS_main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = iOS_main.mm; sourceTree = ""; }; - 1960664F16F57D3B008FFBDF /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 1960665016F57D3B008FFBDF /* WLAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WLAppDelegate.h; sourceTree = ""; }; - 1960665116F57D3B008FFBDF /* WLAppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WLAppDelegate.mm; sourceTree = ""; }; - 1960665216F57D3B008FFBDF /* WLViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WLViewController.h; sourceTree = ""; }; - 1960665316F57D3B008FFBDF /* WLViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WLViewController.mm; sourceTree = ""; }; - 1960665516F57D3B008FFBDF /* Bitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bitmap.cpp; sourceTree = ""; }; - 1960665616F57D3B008FFBDF /* Bitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bitmap.h; sourceTree = ""; }; - 1960665716F57D3B008FFBDF /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = ""; }; - 1960665816F57D3B008FFBDF /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = ""; }; - 1960665916F57D3B008FFBDF /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; - 1960665A16F57D3B008FFBDF /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; - 1960665B16F57D3B008FFBDF /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; }; - 1960665C16F57D3B008FFBDF /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; }; - 1960666716F57D7B008FFBDF /* stb_image.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stb_image.c; sourceTree = ""; }; - 1960666916F57D7B008FFBDF /* fragment-shader.txt */ = {isa = PBXFileReference; explicitFileType = sourcecode.glsl; fileEncoding = 4; path = "fragment-shader.txt"; sourceTree = ""; }; - 1960666B16F57D7B008FFBDF /* vertex-shader.txt */ = {isa = PBXFileReference; explicitFileType = sourcecode.glsl; fileEncoding = 4; path = "vertex-shader.txt"; sourceTree = ""; }; - 1960667016F594A7008FFBDF /* wooden-crate.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "wooden-crate.jpg"; sourceTree = ""; }; - 1960667216F59A08008FFBDF /* Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Camera.cpp; sourceTree = ""; }; - 1960667316F59A08008FFBDF /* Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Camera.h; sourceTree = ""; }; - 198F9C1E16F5685900316EC8 /* 04_camera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 04_camera.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 198F9C2116F5685900316EC8 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 198F9C2316F5685900316EC8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 198F9C2516F5685900316EC8 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 198F9C2716F5685900316EC8 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; - 198F9C2916F5685900316EC8 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; - 198F9C5E16F569CC00316EC8 /* 01_project_skeleton-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "01_project_skeleton-Info.plist"; sourceTree = ""; }; - 198F9C5F16F569CC00316EC8 /* 01_project_skeleton-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "01_project_skeleton-Prefix.pch"; sourceTree = ""; }; - 198F9C6016F569CC00316EC8 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - 198F9C6116F569CC00316EC8 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - 198F9C6216F569CC00316EC8 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 198F9C1B16F5685900316EC8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1949ADDF16F5D20600287931 /* CoreMotion.framework in Frameworks */, - 198F9C2216F5685900316EC8 /* UIKit.framework in Frameworks */, - 198F9C2416F5685900316EC8 /* Foundation.framework in Frameworks */, - 198F9C2616F5685900316EC8 /* CoreGraphics.framework in Frameworks */, - 198F9C2816F5685900316EC8 /* GLKit.framework in Frameworks */, - 198F9C2A16F5685900316EC8 /* OpenGLES.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1960664B16F57D3B008FFBDF /* source */ = { - isa = PBXGroup; - children = ( - 1960664C16F57D3B008FFBDF /* iOS_main.h */, - 1960664D16F57D3B008FFBDF /* iOS_main.mm */, - 1960664E16F57D3B008FFBDF /* ios_specific */, - 1960665416F57D3B008FFBDF /* tdogl */, - ); - path = source; - sourceTree = ""; - }; - 1960664E16F57D3B008FFBDF /* ios_specific */ = { - isa = PBXGroup; - children = ( - 1960664F16F57D3B008FFBDF /* main.m */, - 1960665016F57D3B008FFBDF /* WLAppDelegate.h */, - 1960665116F57D3B008FFBDF /* WLAppDelegate.mm */, - 1960665216F57D3B008FFBDF /* WLViewController.h */, - 1960665316F57D3B008FFBDF /* WLViewController.mm */, - ); - path = ios_specific; - sourceTree = ""; - }; - 1960665416F57D3B008FFBDF /* tdogl */ = { - isa = PBXGroup; - children = ( - 1960665516F57D3B008FFBDF /* Bitmap.cpp */, - 1960665616F57D3B008FFBDF /* Bitmap.h */, - 1960665716F57D3B008FFBDF /* Program.cpp */, - 1960665816F57D3B008FFBDF /* Program.h */, - 1960665916F57D3B008FFBDF /* Shader.cpp */, - 1960665A16F57D3B008FFBDF /* Shader.h */, - 1960665B16F57D3B008FFBDF /* Texture.cpp */, - 1960665C16F57D3B008FFBDF /* Texture.h */, - 1960667216F59A08008FFBDF /* Camera.cpp */, - 1960667316F59A08008FFBDF /* Camera.h */, - ); - path = tdogl; - sourceTree = ""; - }; - 1960666516F57D7B008FFBDF /* thirdparty */ = { - isa = PBXGroup; - children = ( - 1960666616F57D7B008FFBDF /* stb_image */, - ); - path = thirdparty; - sourceTree = ""; - }; - 1960666616F57D7B008FFBDF /* stb_image */ = { - isa = PBXGroup; - children = ( - 1960666716F57D7B008FFBDF /* stb_image.c */, - ); - path = stb_image; - sourceTree = ""; - }; - 1960666816F57D7B008FFBDF /* resources */ = { - isa = PBXGroup; - children = ( - 1960667016F594A7008FFBDF /* wooden-crate.jpg */, - 1960666916F57D7B008FFBDF /* fragment-shader.txt */, - 1960666B16F57D7B008FFBDF /* vertex-shader.txt */, - ); - path = resources; - sourceTree = ""; - }; - 198F9C1516F5685900316EC8 = { - isa = PBXGroup; - children = ( - 1960664B16F57D3B008FFBDF /* source */, - 198F9C5D16F569CC00316EC8 /* sys */, - 1960666516F57D7B008FFBDF /* thirdparty */, - 1960666816F57D7B008FFBDF /* resources */, - 198F9C2016F5685900316EC8 /* Frameworks */, - 198F9C1F16F5685900316EC8 /* Products */, - ); - sourceTree = ""; - }; - 198F9C1F16F5685900316EC8 /* Products */ = { - isa = PBXGroup; - children = ( - 198F9C1E16F5685900316EC8 /* 04_camera.app */, - ); - name = Products; - sourceTree = ""; - }; - 198F9C2016F5685900316EC8 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1949ADDE16F5D20600287931 /* CoreMotion.framework */, - 198F9C2116F5685900316EC8 /* UIKit.framework */, - 198F9C2316F5685900316EC8 /* Foundation.framework */, - 198F9C2516F5685900316EC8 /* CoreGraphics.framework */, - 198F9C2716F5685900316EC8 /* GLKit.framework */, - 198F9C2916F5685900316EC8 /* OpenGLES.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 198F9C5D16F569CC00316EC8 /* sys */ = { - isa = PBXGroup; - children = ( - 198F9C5E16F569CC00316EC8 /* 01_project_skeleton-Info.plist */, - 198F9C5F16F569CC00316EC8 /* 01_project_skeleton-Prefix.pch */, - 198F9C6016F569CC00316EC8 /* Default-568h@2x.png */, - 198F9C6116F569CC00316EC8 /* Default.png */, - 198F9C6216F569CC00316EC8 /* Default@2x.png */, - ); - path = sys; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 198F9C1D16F5685900316EC8 /* 04_camera */ = { - isa = PBXNativeTarget; - buildConfigurationList = 198F9C4C16F5685900316EC8 /* Build configuration list for PBXNativeTarget "04_camera" */; - buildPhases = ( - 198F9C1A16F5685900316EC8 /* Sources */, - 198F9C1B16F5685900316EC8 /* Frameworks */, - 198F9C1C16F5685900316EC8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 04_camera; - productName = 01_project_skeleton; - productReference = 198F9C1E16F5685900316EC8 /* 04_camera.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 198F9C1616F5685900316EC8 /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = WL; - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = whackylabs; - }; - buildConfigurationList = 198F9C1916F5685900316EC8 /* Build configuration list for PBXProject "04_camera" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 198F9C1516F5685900316EC8; - productRefGroup = 198F9C1F16F5685900316EC8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 198F9C1D16F5685900316EC8 /* 04_camera */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 198F9C1C16F5685900316EC8 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 198F9C6C16F569CC00316EC8 /* Default-568h@2x.png in Resources */, - 198F9C6D16F569CC00316EC8 /* Default.png in Resources */, - 198F9C6E16F569CC00316EC8 /* Default@2x.png in Resources */, - 1960666D16F57D7B008FFBDF /* fragment-shader.txt in Resources */, - 1960666F16F57D7B008FFBDF /* vertex-shader.txt in Resources */, - 1960667116F594A7008FFBDF /* wooden-crate.jpg in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 198F9C1A16F5685900316EC8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1960665D16F57D3B008FFBDF /* iOS_main.mm in Sources */, - 1960665E16F57D3B008FFBDF /* main.m in Sources */, - 1960665F16F57D3B008FFBDF /* WLAppDelegate.mm in Sources */, - 1960666016F57D3B008FFBDF /* WLViewController.mm in Sources */, - 1960666116F57D3B008FFBDF /* Bitmap.cpp in Sources */, - 1960666216F57D3B008FFBDF /* Program.cpp in Sources */, - 1960666316F57D3B008FFBDF /* Shader.cpp in Sources */, - 1960666416F57D3B008FFBDF /* Texture.cpp in Sources */, - 1960667416F59A08008FFBDF /* Camera.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 198F9C4A16F5685900316EC8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 198F9C4B16F5685900316EC8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 198F9C4D16F5685900316EC8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "sys/01_project_skeleton-Prefix.pch"; - INFOPLIST_FILE = "$(SRCROOT)/sys/01_project_skeleton-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - USER_HEADER_SEARCH_PATHS = "/opt/local/include/**"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 198F9C4E16F5685900316EC8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "sys/01_project_skeleton-Prefix.pch"; - INFOPLIST_FILE = "$(SRCROOT)/sys/01_project_skeleton-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - USER_HEADER_SEARCH_PATHS = "/opt/local/include/**"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 198F9C1916F5685900316EC8 /* Build configuration list for PBXProject "04_camera" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 198F9C4A16F5685900316EC8 /* Debug */, - 198F9C4B16F5685900316EC8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 198F9C4C16F5685900316EC8 /* Build configuration list for PBXNativeTarget "04_camera" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 198F9C4D16F5685900316EC8 /* Debug */, - 198F9C4E16F5685900316EC8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 198F9C1616F5685900316EC8 /* Project object */; -} diff --git a/old/platforms/ios/04_camera/resources/fragment-shader.txt b/old/platforms/ios/04_camera/resources/fragment-shader.txt deleted file mode 100644 index 1c4c1f2..0000000 --- a/old/platforms/ios/04_camera/resources/fragment-shader.txt +++ /dev/null @@ -1,10 +0,0 @@ -#version 100 - -uniform sampler2D tex; - -varying highp vec2 fragTexCoord; - -void main() { - //note: the texture function was called texture2D in older versions of GLSL - gl_FragColor = texture2D(tex, fragTexCoord); -} \ No newline at end of file diff --git a/old/platforms/ios/04_camera/resources/vertex-shader.txt b/old/platforms/ios/04_camera/resources/vertex-shader.txt deleted file mode 100644 index 2343031..0000000 --- a/old/platforms/ios/04_camera/resources/vertex-shader.txt +++ /dev/null @@ -1,17 +0,0 @@ -#version 100 - -uniform mat4 camera; -uniform mat4 model; - -attribute vec3 vert; -attribute vec2 vertTexCoord; - -varying vec2 fragTexCoord; - -void main() { - // Pass the tex coord straight through to the fragment shader - fragTexCoord = vertTexCoord; - - // Apply all matrix transformations to vert - gl_Position = camera * model * vec4(vert, 1); -} \ No newline at end of file diff --git a/old/platforms/ios/04_camera/resources/wooden-crate.jpg b/old/platforms/ios/04_camera/resources/wooden-crate.jpg deleted file mode 100644 index d1c87341ca55543742aeefa9145fea732c166468..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49767 zcm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Ku#DSe1)ZlViEFBP{l4iDix`-YlfD%Oq3G%nJaZ_w3z= zZmEsB)v&l)j%$np{do17$s#puHQkKX=vqJ^L}v{owkxRsBO%9NPtXi<<1kpDODbb* zp;{|Kt-fZRh-_JFGC>3ot0)B|Smb3_lkMY~GNU - -typedef enum{ - eGesture_Move_Forward, //W - eGesture_Move_Back, //S - eGesture_Move_Left, //A - eGesture_Move_Right, //D - eGesture_Move_Up, //Z - eGesture_Move_Down, //X - eGesture_None -}eGesture; - -extern glm::vec2 SCREEN_SIZE; -int iOS_main(); -void Render(); -void Update(float secondsElapsed); -void RegisterGesture(eGesture g); -#endif diff --git a/old/platforms/ios/04_camera/source/iOS_main.mm b/old/platforms/ios/04_camera/source/iOS_main.mm deleted file mode 100644 index 4af5e5f..0000000 --- a/old/platforms/ios/04_camera/source/iOS_main.mm +++ /dev/null @@ -1,266 +0,0 @@ -/* - main - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#include "iOS_main.h" - -// third-party libraries -#import -#include - -// standard C++ libraries -#include -#include -#include -#include - -// tdogl classes -#include "tdogl/Program.h" -#include "tdogl/Texture.h" -#include "tdogl/Camera.h" - -// constants -glm::vec2 SCREEN_SIZE(0, 0); - -// globals -tdogl::Texture* gTexture = NULL; -tdogl::Program* gProgram = NULL; -tdogl::Camera gCamera; -GLuint gVAO = 0; -GLuint gVBO = 0; -GLfloat gDegreesRotated = 0.0f; -eGesture gesture = eGesture_None; - -// returns the full path to the file `fileName` in the resources directory of the app bundle -static std::string ResourcePath(std::string fileName) { - NSString* fname = [NSString stringWithCString:fileName.c_str() encoding:NSUTF8StringEncoding]; - NSString* path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:fname]; - return std::string([path cStringUsingEncoding:NSUTF8StringEncoding]); -} - - -// loads the vertex shader and fragment shader, and links them to make the global gProgram -static void LoadShaders() { - std::vector shaders; - shaders.push_back(tdogl::Shader::shaderFromFile(ResourcePath("vertex-shader.txt"), GL_VERTEX_SHADER)); - shaders.push_back(tdogl::Shader::shaderFromFile(ResourcePath("fragment-shader.txt"), GL_FRAGMENT_SHADER)); - gProgram = new tdogl::Program(shaders); -} - - -// loads a cube into the VAO and VBO globals: gVAO and gVBO -static void LoadCube() { - // make and bind the VAO - glGenVertexArraysOES(1, &gVAO); - glBindVertexArrayOES(gVAO); - - // make and bind the VBO - glGenBuffers(1, &gVBO); - glBindBuffer(GL_ARRAY_BUFFER, gVBO); - - // Make a cube out of triangles (two triangles per side) - GLfloat vertexData[] = { - // X Y Z U V - // bottom - -1.0f,-1.0f,-1.0f, 0.0f, 0.0f, - 1.0f,-1.0f,-1.0f, 1.0f, 0.0f, - -1.0f,-1.0f, 1.0f, 0.0f, 1.0f, - 1.0f,-1.0f,-1.0f, 1.0f, 0.0f, - 1.0f,-1.0f, 1.0f, 1.0f, 1.0f, - -1.0f,-1.0f, 1.0f, 0.0f, 1.0f, - - // top - -1.0f, 1.0f,-1.0f, 0.0f, 0.0f, - -1.0f, 1.0f, 1.0f, 0.0f, 1.0f, - 1.0f, 1.0f,-1.0f, 1.0f, 0.0f, - 1.0f, 1.0f,-1.0f, 1.0f, 0.0f, - -1.0f, 1.0f, 1.0f, 0.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - - // front - -1.0f,-1.0f, 1.0f, 1.0f, 0.0f, - 1.0f,-1.0f, 1.0f, 0.0f, 0.0f, - -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f,-1.0f, 1.0f, 0.0f, 0.0f, - 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, - -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - - // back - -1.0f,-1.0f,-1.0f, 0.0f, 0.0f, - -1.0f, 1.0f,-1.0f, 0.0f, 1.0f, - 1.0f,-1.0f,-1.0f, 1.0f, 0.0f, - 1.0f,-1.0f,-1.0f, 1.0f, 0.0f, - -1.0f, 1.0f,-1.0f, 0.0f, 1.0f, - 1.0f, 1.0f,-1.0f, 1.0f, 1.0f, - - // left - -1.0f,-1.0f, 1.0f, 0.0f, 1.0f, - -1.0f, 1.0f,-1.0f, 1.0f, 0.0f, - -1.0f,-1.0f,-1.0f, 0.0f, 0.0f, - -1.0f,-1.0f, 1.0f, 0.0f, 1.0f, - -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - -1.0f, 1.0f,-1.0f, 1.0f, 0.0f, - - // right - 1.0f,-1.0f, 1.0f, 1.0f, 1.0f, - 1.0f,-1.0f,-1.0f, 1.0f, 0.0f, - 1.0f, 1.0f,-1.0f, 0.0f, 0.0f, - 1.0f,-1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f,-1.0f, 0.0f, 0.0f, - 1.0f, 1.0f, 1.0f, 0.0f, 1.0f - }; - glBufferData(GL_ARRAY_BUFFER, sizeof(vertexData), vertexData, GL_STATIC_DRAW); - - // connect the xyz to the "vert" attribute of the vertex shader - glEnableVertexAttribArray(gProgram->attrib("vert")); - glVertexAttribPointer(gProgram->attrib("vert"), 3, GL_FLOAT, GL_FALSE, 5*sizeof(GLfloat), NULL); - - // connect the uv coords to the "vertTexCoord" attribute of the vertex shader - glEnableVertexAttribArray(gProgram->attrib("vertTexCoord")); - glVertexAttribPointer(gProgram->attrib("vertTexCoord"), 2, GL_FLOAT, GL_TRUE, 5*sizeof(GLfloat), (const GLvoid*)(3 * sizeof(GLfloat))); - - // unbind the VAO - glBindVertexArrayOES(0); -} - - -// loads the file "wooden-crate.jpg" into gTexture -static void LoadTexture() { - tdogl::Bitmap bmp = tdogl::Bitmap::bitmapFromFile(ResourcePath("wooden-crate.jpg")); - bmp.flipVertically(); - gTexture = new tdogl::Texture(bmp); -} - - -// draws a single frame -void Render() { - // clear everything - glClearColor(0, 0, 0, 1); // black - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // bind the program (the shaders) - gProgram->use(); - - // set the "camera" uniform - gProgram->setUniform("camera", gCamera.matrix()); - - // set the "model" uniform in the vertex shader, based on the gDegreesRotated global - gProgram->setUniform("model", glm::rotate(glm::mat4(), gDegreesRotated, glm::vec3(0,1,0))); - - // bind the texture and set the "tex" uniform in the fragment shader - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, gTexture->object()); - gProgram->setUniform("tex", 0); //set to 0 because the texture is bound to GL_TEXTURE0 - - // bind the VAO (the triangle) - glBindVertexArrayOES(gVAO); - - // draw the VAO - glDrawArrays(GL_TRIANGLES, 0, 6*2*3); - - // unbind the VAO, the program and the texture - glBindVertexArrayOES(0); - glBindTexture(GL_TEXTURE_2D, 0); - gProgram->stopUsing(); - -} - - -// update the scene based on the time elapsed since last update -void Update(float secondsElapsed) { - //rotate the cube - const GLfloat degreesPerSecond = 180.0f; - gDegreesRotated += secondsElapsed * degreesPerSecond; - while(gDegreesRotated > 360.0f) gDegreesRotated -= 360.0f; - - //move position of camera based on WASD keys, and XZ keys for up and down - const float moveSpeed = 2.0; //units per second - if(gesture == eGesture_Move_Back){ - gCamera.offsetPosition(secondsElapsed * moveSpeed * -gCamera.forward()); - } else if(gesture == eGesture_Move_Forward){ - gCamera.offsetPosition(secondsElapsed * moveSpeed * gCamera.forward()); - } - if(gesture == eGesture_Move_Left){ - gCamera.offsetPosition(secondsElapsed * moveSpeed * -gCamera.right()); - } else if(gesture == eGesture_Move_Right){ - gCamera.offsetPosition(secondsElapsed * moveSpeed * gCamera.right()); - } - if(gesture == eGesture_Move_Up){ - gCamera.offsetPosition(secondsElapsed * moveSpeed * -glm::vec3(0,1,0)); - } else if(gesture == eGesture_Move_Down){ - gCamera.offsetPosition(secondsElapsed * moveSpeed * glm::vec3(0,1,0)); - } - - //rotate camera based on mouse movement -// const float mouseSensitivity = 0.1; -// int mouseX, mouseY; -// glfwGetMousePos(&mouseX, &mouseY); -// gCamera.offsetOrientation(mouseSensitivity * mouseY, mouseSensitivity * mouseX); -// glfwSetMousePos(0, 0); //reset the mouse, so it doesn't go out of the window -// -// //increase or decrease field of view based on mouse wheel -// const float zoomSensitivity = -0.2; -// float fieldOfView = gCamera.fieldOfView() + zoomSensitivity * (float)glfwGetMouseWheel(); -// if(fieldOfView < 5.0f) fieldOfView = 5.0f; -// if(fieldOfView > 130.0f) fieldOfView = 130.0f; -// gCamera.setFieldOfView(fieldOfView); -// glfwSetMouseWheel(0); -} - -void RegisterGesture(eGesture g){ - gesture = g; -} - -// the program starts here -void AppMain() { - - // print out some info about the graphics drivers - std::cout << "OpenGL version: " << glGetString(GL_VERSION) << std::endl; - std::cout << "GLSL version: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl; - std::cout << "Vendor: " << glGetString(GL_VENDOR) << std::endl; - std::cout << "Renderer: " << glGetString(GL_RENDERER) << std::endl; - - - // OpenGL settings - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LESS); - - // load vertex and fragment shaders into opengl - LoadShaders(); - - // load the texture - LoadTexture(); - - // create buffer and fill it with the points of the triangle - LoadCube(); - - // setup gCamera - gCamera.setPosition(glm::vec3(0,0,10)); - gCamera.setViewportAspectRatio(SCREEN_SIZE.x / SCREEN_SIZE.y); -} - - -int iOS_main() { - try { - AppMain(); - } catch (const std::exception& e){ - std::cerr << "ERROR: " << e.what() << std::endl; - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; -} diff --git a/old/platforms/ios/04_camera/source/ios_specific/WLAppDelegate.h b/old/platforms/ios/04_camera/source/ios_specific/WLAppDelegate.h deleted file mode 100644 index 643b377..0000000 --- a/old/platforms/ios/04_camera/source/ios_specific/WLAppDelegate.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// WLAppDelegate.h -// 01_project_skeleton -// -// Created by Sid on 17/03/13. -// Copyright (c) 2013 whackylabs. All rights reserved. -// - -#import - -@class WLViewController; - -@interface WLAppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@property (strong, nonatomic) WLViewController *viewController; - -@end diff --git a/old/platforms/ios/04_camera/source/ios_specific/WLAppDelegate.mm b/old/platforms/ios/04_camera/source/ios_specific/WLAppDelegate.mm deleted file mode 100644 index b357b3b..0000000 --- a/old/platforms/ios/04_camera/source/ios_specific/WLAppDelegate.mm +++ /dev/null @@ -1,59 +0,0 @@ -// -// WLAppDelegate.m -// 01_project_skeleton -// -// Created by Sid on 17/03/13. -// Copyright (c) 2013 whackylabs. All rights reserved. -// - -#import "WLAppDelegate.h" - -#import "WLViewController.h" - -@implementation WLAppDelegate - -- (void)dealloc -{ - [_window release]; - [_viewController release]; - [super dealloc]; -} - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; - // Override point for customization after application launch. - self.viewController = [[[WLViewController alloc] initWithNibName:nil bundle:nil] autorelease]; - self.window.rootViewController = self.viewController; - [self.window makeKeyAndVisible]; - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application -{ - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application -{ - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application -{ - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application -{ - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application -{ - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - -@end diff --git a/old/platforms/ios/04_camera/source/ios_specific/WLViewController.h b/old/platforms/ios/04_camera/source/ios_specific/WLViewController.h deleted file mode 100644 index c531c28..0000000 --- a/old/platforms/ios/04_camera/source/ios_specific/WLViewController.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// WLViewController.h -// 01_project_skeleton -// -// Created by Sid on 17/03/13. -// Copyright (c) 2013 whackylabs. All rights reserved. -// - -#import -#import - -@interface WLViewController : GLKViewController - -@end diff --git a/old/platforms/ios/04_camera/source/ios_specific/WLViewController.mm b/old/platforms/ios/04_camera/source/ios_specific/WLViewController.mm deleted file mode 100644 index 2f88870..0000000 --- a/old/platforms/ios/04_camera/source/ios_specific/WLViewController.mm +++ /dev/null @@ -1,198 +0,0 @@ -// -// WLViewController.m -// 01_project_skeleton -// -// Created by Sid on 17/03/13. -// Copyright (c) 2013 whackylabs. All rights reserved. -// - -#import "WLViewController.h" - -#import - -#import "iOS_main.h" - -//GL_State masks flags -#define kGL_StateUnknown (1<<0) //Unknown -#define kGL_StateInit (1<<1) //Init -#define kGL_StateSetup (1<<2) //Setup -#define kGL_StateRender (1<<3) //Ready to render -#define kGL_StateUpdate (1<<4) //Ready to update -@interface WLViewController(){ - int glState; - CMMotionManager *motionMgr; -} -@property (strong, nonatomic) EAGLContext *context; -// Research shows that screen's width and height are prepared after the update call. -// And glkView:drawInRect: gets invoked first. -// Let's wait for all the setup to get over with. -- (void)GL_WillSetup; -- (void)GL_DidSetup; -- (void)GL_Destroy; -@end - -@implementation WLViewController - -- (void)dealloc{ - [self GL_Destroy]; - if ([EAGLContext currentContext] == self.context) { - [EAGLContext setCurrentContext:nil]; - } - [_context release]; - [motionMgr release]; - [super dealloc]; -} - -- (void)viewDidLoad{ - [super viewDidLoad]; - self.context = [[[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2] autorelease]; - if (!self.context) { - [NSException raise:@"Failed to create ES context" format:@""]; - } - GLKView *view = (GLKView *)self.view; - view.context = self.context; - view.drawableDepthFormat = GLKViewDrawableDepthFormat24; - - motionMgr = [[CMMotionManager alloc]init]; - - NSLog(@"State: Unknown"); - glState = kGL_StateUnknown; - [self GL_WillSetup]; -} - -- (void)didReceiveMemoryWarning{ - [super didReceiveMemoryWarning]; - - if ([self isViewLoaded] && ([[self view] window] == nil)) { - self.view = nil; - [self GL_Destroy]; - if ([EAGLContext currentContext] == self.context) { - [EAGLContext setCurrentContext:nil]; - } - self.context = nil; - } -} - -// Doesn't has right value for screen dimensions -- (void)GL_WillSetup{ - [EAGLContext setCurrentContext:self.context]; - glState |= kGL_StateInit; - NSLog(@"State: Init"); -} - -// Could be called multiple times. Do check. -// We've the screen ready --(void)GL_DidSetup{ - // already in setup state = do nothing - if(glState & kGL_StateSetup){ - NSLog(@"State: Already setup"); - return; - } - // or is not in ready state = do nothing - if(!(glState & kGL_StateInit)){ - NSLog(@"State: NOT Init"); - return; - } - if(!(glState & kGL_StateRender)){ - NSLog(@"State: NOT Render"); - return; - } - if(!(glState & kGL_StateUpdate)){ - NSLog(@"State: NOT Update"); - return; - } - - // constants - SCREEN_SIZE = glm::vec2(self.view.bounds.size.width, self.view.bounds.size.height); - iOS_main(); - glState |= kGL_StateSetup; - NSLog(@"State: Setup"); - - [motionMgr startAccelerometerUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) { - double x = accelerometerData.acceleration.x; - if(x < 0.06){ - RegisterGesture(eGesture_Move_Up); - }else if( x > 0.12){ - RegisterGesture(eGesture_Move_Down); - } - }]; -} - -- (void)GL_Destroy{ - [EAGLContext setCurrentContext:self.context]; - glState = kGL_StateUnknown; - - [motionMgr stopAccelerometerUpdates]; - NSLog(@"State: Unknown"); -} - -//Loop -- (void)update{ - //Skip if not in setup state. - if(!(glState & kGL_StateSetup)){ - glState |= kGL_StateUpdate; - NSLog(@"State: Update"); - [self GL_DidSetup]; - return; - } - Update(self.timeSinceLastUpdate); -} - -- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect{ - //Skip if not in setup state. - if(!(glState & kGL_StateSetup)){ - glState |= kGL_StateRender; - NSLog(@"State: Render"); - [self GL_DidSetup]; - return; - } - - Render(); -} - -//Dividing the Screen into a rect of 3x3, with key mapping as -// ------------- -// | - | W | - | -// ------------- -// | A | - | D | -// ------------- -// | - | S | - | -// ------------- --(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ - UITouch *t = [touches anyObject]; - CGPoint tPt = [t locationInView:self.view]; - double scr_w_one_third = self.view.bounds.size.width/3; - double scr_h_one_third = self.view.bounds.size.height/3; - int touch_index_x = tPt.x/scr_w_one_third; - int touch_index_y = tPt.y/scr_h_one_third; - - switch(touch_index_x){ - case 0: - if(touch_index_y == 1){ - RegisterGesture(eGesture_Move_Left); - } - break; - - case 1: - if(touch_index_y == 0){ - RegisterGesture(eGesture_Move_Forward); - }else if(touch_index_y == 2){ - RegisterGesture(eGesture_Move_Back); - } - break; - - case 2: - if(touch_index_y == 1){ - RegisterGesture(eGesture_Move_Right); - } - break; - } -} - --(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ -} - --(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ - RegisterGesture(eGesture_None); -} -@end diff --git a/old/platforms/ios/04_camera/source/ios_specific/main.m b/old/platforms/ios/04_camera/source/ios_specific/main.m deleted file mode 100644 index 96afe77..0000000 --- a/old/platforms/ios/04_camera/source/ios_specific/main.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// main.m -// 01_project_skeleton -// -// Created by Sid on 17/03/13. -// Copyright (c) 2013 whackylabs. All rights reserved. -// - -#import - -#import "WLAppDelegate.h" - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([WLAppDelegate class])); - } -} diff --git a/old/platforms/ios/04_camera/source/tdogl/Bitmap.cpp b/old/platforms/ios/04_camera/source/tdogl/Bitmap.cpp deleted file mode 100644 index ca96c0e..0000000 --- a/old/platforms/ios/04_camera/source/tdogl/Bitmap.cpp +++ /dev/null @@ -1,352 +0,0 @@ -/* - tdogl::Bitmap - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#include "Bitmap.h" -#include - -//uses stb_image to try load files -#define STBI_FAILURE_USERMSG -#include "../../thirdparty/stb_image/stb_image.c" - -using namespace tdogl; - - -inline unsigned char AverageRGB(unsigned char rgb[3]) { - return (unsigned char)(((double)rgb[0] + (double)rgb[1] + (double)rgb[2]) / 3.0); -} - -static void Grayscale2GrayscaleAlpha(unsigned char* src, unsigned char* dest){ - dest[0] = src[0]; - dest[1] = 255; -} - -static void Grayscale2RGB(unsigned char* src, unsigned char* dest){ - dest[0] = src[0]; - dest[1] = src[0]; - dest[2] = src[0]; -} - -static void Grayscale2RGBA(unsigned char* src, unsigned char* dest){ - dest[0] = src[0]; - dest[1] = src[0]; - dest[2] = src[0]; - dest[3] = 255; -} - -static void GrayscaleAlpha2Grayscale(unsigned char* src, unsigned char* dest){ - dest[0] = src[0]; -} - -static void GrayscaleAlpha2RGB(unsigned char* src, unsigned char* dest){ - dest[0] = src[0]; - dest[1] = src[0]; - dest[2] = src[0]; -} - -static void GrayscaleAlpha2RGBA(unsigned char* src, unsigned char* dest){ - dest[0] = src[0]; - dest[1] = src[0]; - dest[2] = src[0]; - dest[3] = src[1]; -} - -static void RGB2Grayscale(unsigned char* src, unsigned char* dest){ - dest[0] = AverageRGB(src); -} - -static void RGB2GrayscaleAlpha(unsigned char* src, unsigned char* dest){ - dest[0] = AverageRGB(src); - dest[1] = 255; -} - -static void RGB2RGBA(unsigned char* src, unsigned char* dest){ - dest[0] = src[0]; - dest[1] = src[1]; - dest[2] = src[2]; - dest[3] = 255; -} - -static void RGBA2Grayscale(unsigned char* src, unsigned char* dest){ - dest[0] = AverageRGB(src); -} - -static void RGBA2GrayscaleAlpha(unsigned char* src, unsigned char* dest){ - dest[0] = AverageRGB(src); - dest[1] = src[3]; -} - -static void RGBA2RGB(unsigned char* src, unsigned char* dest){ - dest[0] = src[0]; - dest[1] = src[1]; - dest[2] = src[2]; -} - -typedef void(*FormatConverterFunc)(unsigned char*, unsigned char*); - -static FormatConverterFunc ConverterFuncForFormats(Bitmap::Format srcFormat, Bitmap::Format destFormat){ - if(srcFormat == destFormat) - throw std::runtime_error("Just use memcpy if pixel formats are the same"); - - switch(srcFormat){ - - case Bitmap::Format_Grayscale: - switch(destFormat){ - case Bitmap::Format_GrayscaleAlpha: return Grayscale2GrayscaleAlpha; - case Bitmap::Format_RGB: return Grayscale2RGB; - case Bitmap::Format_RGBA: return Grayscale2RGBA; - default: - throw std::runtime_error("Unhandled bitmap format"); - } - break; - - case Bitmap::Format_GrayscaleAlpha: - switch(destFormat){ - case Bitmap::Format_Grayscale: return GrayscaleAlpha2Grayscale; - case Bitmap::Format_RGB: return GrayscaleAlpha2RGB; - case Bitmap::Format_RGBA: return GrayscaleAlpha2RGBA; - default: - throw std::runtime_error("Unhandled bitmap format"); - } - break; - - case Bitmap::Format_RGB: - switch(destFormat){ - case Bitmap::Format_Grayscale: return RGB2Grayscale; - case Bitmap::Format_GrayscaleAlpha: return RGB2GrayscaleAlpha; - case Bitmap::Format_RGBA: return RGB2RGBA; - default: - throw std::runtime_error("Unhandled bitmap format"); - } - break; - - case Bitmap::Format_RGBA: - switch(destFormat){ - case Bitmap::Format_Grayscale: return RGBA2Grayscale; - case Bitmap::Format_GrayscaleAlpha: return RGBA2GrayscaleAlpha; - case Bitmap::Format_RGB: return RGBA2RGB; - default: - throw std::runtime_error("Unhandled bitmap format"); - } - break; - - default: - throw std::runtime_error("Unhandled bitmap format"); - } -} - - -/* - * Misc funcs - */ - -inline unsigned GetPixelOffset(unsigned col, unsigned row, unsigned width, unsigned height, Bitmap::Format format) { - return (row*width + col)*format; -} - -inline bool RectsOverlap(unsigned srcCol, unsigned srcRow, unsigned destCol, unsigned destRow, unsigned width, unsigned height){ - unsigned colDiff = srcCol > destCol ? srcCol - destCol : destCol - srcCol; - if(colDiff < width) - return true; - - unsigned rowDiff = srcRow > destRow ? srcRow - destRow : destRow - srcRow; - if(rowDiff < height) - return true; - - return false; -} - - -/* - * Bitmap class - */ - -Bitmap::Bitmap(unsigned width, - unsigned height, - Format format, - const unsigned char* pixels) : - _pixels(NULL) -{ - _set(width, height, format, pixels); -} - -Bitmap::~Bitmap() { - if(_pixels) free(_pixels); -} - -Bitmap Bitmap::bitmapFromFile(std::string filePath) { - int width, height, channels; - unsigned char* pixels = stbi_load(filePath.c_str(), &width, &height, &channels, 0); - if(!pixels) throw std::runtime_error(stbi_failure_reason()); - - Bitmap bmp(width, height, (Format)channels, pixels); - stbi_image_free(pixels); - return bmp; -} - -Bitmap::Bitmap(const Bitmap& other) : - _pixels(NULL) -{ - _set(other._width, other._height, other._format, other._pixels); -} - -Bitmap& Bitmap::operator = (const Bitmap& other) { - _set(other._width, other._height, other._format, other._pixels); - return *this; -} - -unsigned int Bitmap::width() const { - return _width; -} - -unsigned int Bitmap::height() const { - return _height; -} - -Bitmap::Format Bitmap::format() const { - return _format; -} - -unsigned char* Bitmap::pixelBuffer() const { - return _pixels; -} - -unsigned char* Bitmap::getPixel(unsigned int column, unsigned int row) const { - if(column >= _width || row >= _height) - throw std::runtime_error("Pixel coordinate out of bounds"); - - return _pixels + GetPixelOffset(column, row, _width, _height, _format); -} - -void Bitmap::setPixel(unsigned int column, unsigned int row, const unsigned char* pixel) { - unsigned char* myPixel = getPixel(column, row); - memcpy(myPixel, pixel, _format); -} - -void Bitmap::flipVertically() { - unsigned long rowSize = _format*_width; - unsigned char* rowBuffer = new unsigned char[rowSize]; - unsigned halfRows = _height / 2; - - for(unsigned rowIdx = 0; rowIdx < halfRows; ++rowIdx){ - unsigned char* row = _pixels + GetPixelOffset(0, rowIdx, _width, _height, _format); - unsigned char* oppositeRow = _pixels + GetPixelOffset(0, _height - rowIdx - 1, _width, _height, _format); - - memcpy(rowBuffer, row, rowSize); - memcpy(row, oppositeRow, rowSize); - memcpy(oppositeRow, rowBuffer, rowSize); - } - - delete rowBuffer; -} - -void Bitmap::rotate90CounterClockwise() { - unsigned char* newPixels = (unsigned char*) malloc(_format*_width*_height); - - for(unsigned row = 0; row < _height; ++row){ - for(unsigned col = 0; col < _width; ++col){ - unsigned srcOffset = GetPixelOffset(col, row, _width, _height, _format); - unsigned destOffset = GetPixelOffset(row, _width - col - 1, _height, _width, _format); - memcpy(newPixels + destOffset, _pixels + srcOffset, _format); //copy one pixel - } - } - - free(_pixels); - _pixels = newPixels; - - unsigned swapTmp = _height; - _height = _width; - _width = swapTmp; -} - -void Bitmap::copyRectFromBitmap(const Bitmap& src, - unsigned srcCol, - unsigned srcRow, - unsigned destCol, - unsigned destRow, - unsigned width, - unsigned height) -{ - if (srcCol == 0 && srcRow == 0 && width == 0 && height == 0){ - width = src.width(); - height = src.height(); - } - - if(width == 0 || height == 0) - throw std::runtime_error("Can't copy zero height/width rectangle"); - - if(srcCol + width >= src.width() || srcRow + height >= src.height()) - throw std::runtime_error("Rectangle doesn't fit within source bitmap"); - - if(destCol + width >= _width || destRow + height >= _height) - throw std::runtime_error("Rectangle doesn't fit within destination bitmap"); - - if(_pixels == src._pixels && RectsOverlap(srcCol, srcRow, destCol, destRow, width, height)) - throw std::runtime_error("Source and destination are the same bitmap, and rects overlap. Not allowed!"); - - FormatConverterFunc converter = NULL; - if(_format != src._format) - converter = ConverterFuncForFormats(_format, src._format); - - for(unsigned row = 0; row < height; ++row){ - for(unsigned col = 0; col < width; ++col){ - unsigned char* srcPixel = src._pixels + GetPixelOffset(srcCol + col, srcRow + row, src._width, src._height, src._format); - unsigned char* destPixel = _pixels + GetPixelOffset(destCol + col, destRow + row, _width, _height, _format); - - if(converter){ - converter(srcPixel, destPixel); - } else { - memcpy(destPixel, srcPixel, _format); - } - } - } -} - -void Bitmap::_set(unsigned width, - unsigned height, - Format format, - const unsigned char* pixels) -{ - if(width == 0) throw std::runtime_error("Zero width bitmap"); - if(height == 0) throw std::runtime_error("Zero height bitmap"); - if(format <= 0 || format > 4) throw std::runtime_error("Invalid bitmap format"); - - _width = width; - _height = height; - _format = format; - - size_t newSize = _width * _height * _format; - if(_pixels){ - _pixels = (unsigned char*)realloc(_pixels, newSize); - } else { - _pixels = (unsigned char*)malloc(newSize); - } - - if(pixels) - memcpy(_pixels, pixels, newSize); -} - - - - - - - - - - - diff --git a/old/platforms/ios/04_camera/source/tdogl/Bitmap.h b/old/platforms/ios/04_camera/source/tdogl/Bitmap.h deleted file mode 100644 index 375c53a..0000000 --- a/old/platforms/ios/04_camera/source/tdogl/Bitmap.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - tdogl::Bitmap - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#pragma once - -#include - -namespace tdogl { - - /** - A bitmap image (i.e. a grid of pixels). - - This is not really related to OpenGL, but can be used to make OpenGL textures using - tdogl::Texture. - */ - class Bitmap { - public: - /** - Represents the number of channels per pixel, and the order of the channels. - - Each channel is one byte (unsigned char). - */ - enum Format { - Format_Grayscale = 1, /**< one channel: grayscale */ - Format_GrayscaleAlpha = 2, /**< two channels: grayscale and alpha */ - Format_RGB = 3, /**< three channels: red, green, blue */ - Format_RGBA = 4 /**< four channels: red, green, blue, alpha */ - }; - - /** - Creates a new image with the specified width, height and format. - - Width and height are in pixels. Image will contain random garbage if - pixels = NULL. - */ - Bitmap(unsigned width, - unsigned height, - Format format, - const unsigned char* pixels = NULL); - ~Bitmap(); - - /** - Tries to load the given file into a tdogl::Bitmap. - */ - static Bitmap bitmapFromFile(std::string filePath); - - /** width in pixels */ - unsigned width() const; - - /** height in pixels */ - unsigned height() const; - - /** the pixel format of the bitmap */ - Format format() const; - - /** - Pointer to the raw pixel data of the bitmap. - - Each channel is 1 byte. The number and meaning of channels per pixel is specified - by the `Format` of the image. The pointer points to all the columns of - the top row of the image, followed by each remaining row down to the bottom. - i.e. c0r0, c1r0, c2r0, ..., c0r1, c1r1, c2r1, etc - */ - unsigned char* pixelBuffer() const; - - /** - Returns a pointer to the start of the pixel at the given coordinates. - - The size of the pixel depends on the `Format` of the image. - */ - unsigned char* getPixel(unsigned int column, unsigned int row) const; - - /** - Sets the raw pixel data at the given coordinates. - - The size of the pixel depends on the `Format` of the bitmap. - */ - void setPixel(unsigned int column, unsigned int row, const unsigned char* pixel); - - /** - Reverses the row order of the pixels, so the bitmap will be upside down. - */ - void flipVertically(); - - /** - Rotates the image 90 degrees counter clockwise. - */ - void rotate90CounterClockwise(); - - /** - Copies a rectangular area from the given source bitmap into this bitmap. - - If srcCol, srcRow, width, and height are all zero, the entire source - bitmap will be copied (full width and height). - - If the source bitmap has a different format to the destination bitmap, - the pixels will be converted to match the destination format. - - Will throw and exception if the source and destination bitmaps are the - same, and the source and destination rectangles overlap. If you want to - copy a bitmap onto itself, then make a copy of the bitmap first. - */ - void copyRectFromBitmap(const Bitmap& src, - unsigned srcCol, - unsigned srcRow, - unsigned destCol, - unsigned destRow, - unsigned width, - unsigned height); - - /** Copy constructor */ - Bitmap(const Bitmap& other); - - /** Assignment operator */ - Bitmap& operator = (const Bitmap& other); - - private: - Format _format; - unsigned _width; - unsigned _height; - unsigned char* _pixels; - - void _set(unsigned width, unsigned height, Format format, const unsigned char* pixels); - static void _getPixelOffset(unsigned col, unsigned row, unsigned width, unsigned height, Format format); - }; - -} diff --git a/old/platforms/ios/04_camera/source/tdogl/Camera.cpp b/old/platforms/ios/04_camera/source/tdogl/Camera.cpp deleted file mode 100644 index 7d62282..0000000 --- a/old/platforms/ios/04_camera/source/tdogl/Camera.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - tdogl::Camera - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -#define _USE_MATH_DEFINES -#include -#include "Camera.h" -#include - -using namespace tdogl; - -static const float MaxVerticalAngle = 85.0f; //must be less than 90 to avoid gimbal lock - -static inline float RadiansToDegrees(float radians) { - return radians * 180.0f / (float)M_PI; -} - - -Camera::Camera() : - _position(0.0f, 0.0f, 1.0f), - _horizontalAngle(0.0f), - _verticalAngle(0.0f), - _fieldOfView(50.0f), - _nearPlane(0.01f), - _farPlane(100.0f), - _viewportAspectRatio(4.0f/3.0f) -{ -} - -const glm::vec3& Camera::position() const { - return _position; -} - -void Camera::setPosition(const glm::vec3& position) { - _position = position; -} - -void Camera::offsetPosition(const glm::vec3& offset) { - _position += offset; -} - -float Camera::fieldOfView() const { - return _fieldOfView; -} - -void Camera::setFieldOfView(float fieldOfView) { - assert(fieldOfView > 0.0f && fieldOfView < 180.0f); - _fieldOfView = fieldOfView; -} - -float Camera::nearPlane() const { - return _nearPlane; -} - -float Camera::farPlane() const { - return _farPlane; -} - -void Camera::setNearAndFarPlanes(float nearPlane, float farPlane) { - assert(nearPlane > 0.0f); - assert(farPlane > nearPlane); - _nearPlane = nearPlane; - _farPlane = farPlane; -} - -glm::mat4 Camera::orientation() const { - glm::mat4 orientation; - orientation = glm::rotate(orientation, _verticalAngle, glm::vec3(1,0,0)); - orientation = glm::rotate(orientation, _horizontalAngle, glm::vec3(0,1,0)); - return orientation; -} - -void Camera::offsetOrientation(float upAngle, float rightAngle) { - _horizontalAngle += rightAngle; - _verticalAngle += upAngle; - normalizeAngles(); -} - -void Camera::lookAt(glm::vec3 position) { - assert(position != _position); - glm::vec3 direction = glm::normalize(position - _position); - _verticalAngle = RadiansToDegrees(asinf(-direction.y)); - _horizontalAngle = -RadiansToDegrees(atan2f(-direction.x, -direction.z)); - normalizeAngles(); -} - -float Camera::viewportAspectRatio() const { - return _viewportAspectRatio; -} - -void Camera::setViewportAspectRatio(float viewportAspectRatio) { - assert(viewportAspectRatio > 0.0); - _viewportAspectRatio = viewportAspectRatio; -} - -glm::vec3 Camera::forward() const { - glm::vec4 forward = glm::inverse(orientation()) * glm::vec4(0,0,-1,1); - return glm::vec3(forward); -} - -glm::vec3 Camera::right() const { - glm::vec4 right = glm::inverse(orientation()) * glm::vec4(1,0,0,1); - return glm::vec3(right); -} - -glm::vec3 Camera::up() const { - glm::vec4 up = glm::inverse(orientation()) * glm::vec4(0,1,0,1); - return glm::vec3(up); -} - -glm::mat4 Camera::matrix() const { - return projection() * view(); -} - -glm::mat4 Camera::projection() const { - return glm::perspective(_fieldOfView, _viewportAspectRatio, _nearPlane, _farPlane); -} - -glm::mat4 Camera::view() const { - return orientation() * glm::translate(glm::mat4(), -_position); -} - -void Camera::normalizeAngles() { - _horizontalAngle = fmodf(_horizontalAngle, 360.0f); - //fmodf can return negative values, but this will make them all positive - if(_horizontalAngle < 0.0f) - _horizontalAngle += 360.0f; - - if(_verticalAngle > MaxVerticalAngle) - _verticalAngle = MaxVerticalAngle; - else if(_verticalAngle < -MaxVerticalAngle) - _verticalAngle = -MaxVerticalAngle; -} \ No newline at end of file diff --git a/old/platforms/ios/04_camera/source/tdogl/Camera.h b/old/platforms/ios/04_camera/source/tdogl/Camera.h deleted file mode 100644 index a28fff2..0000000 --- a/old/platforms/ios/04_camera/source/tdogl/Camera.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - tdogl::Camera - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#pragma once - -#include - - -namespace tdogl { - - /** - A first-person shooter type of camera. - - Set the properties of the camera, then use the `matrix` method to get the camera matrix for - use in the vertex shader. - - Includes the perspective projection matrix. - */ - class Camera { - public: - Camera(); - - /** - The position of the camera. - */ - const glm::vec3& position() const; - void setPosition(const glm::vec3& position); - void offsetPosition(const glm::vec3& offset); - - /** - The vertical viewing angle of the camera, in degrees. - - Determines how "wide" the view of the camera is. Large angles appear to be zoomed out, - as the camera has a wide view. Small values appear to be zoomed in, as the camera has a - very narrow view. - - The value must be between 0 and 180. - */ - float fieldOfView() const; - void setFieldOfView(float fieldOfView); - - /** - The closest visible distance from the camera. - - Objects that are closer to the camera than the near plane distance will not be visible. - - Value must be greater than 0. - */ - float nearPlane() const; - - /** - The farthest visible distance from the camera. - - Objects that are further away from the than the far plane distance will not be visible. - - Value must be greater than the near plane - */ - float farPlane() const; - - /** - Sets the near and far plane distances. - - Everything between the near plane and the var plane will be visible. Everything closer - than the near plane, or farther than the far plane, will not be visible. - - @param nearPlane Minimum visible distance from camera. Must be > 0 - @param farPlane Maximum visible distance from vamera. Must be > nearPlane - */ - void setNearAndFarPlanes(float nearPlane, float farPlane); - - /** - A rotation matrix that determines the direction the camera is looking. - - Does not include translation (the camera's position). - */ - glm::mat4 orientation() const; - - /** - Offsets the cameras orientation. - - The verticle angle is constrained between 85deg and -85deg to avoid gimbal lock. - - @param upAngle the angle (in degrees) to offset upwards. Negative values are downwards. - @param rightAngle the angle (in degrees) to offset rightwards. Negative values are leftwards. - */ - void offsetOrientation(float upAngle, float rightAngle); - - /** - Orients the camera so that is it directly facing `position` - - @param position the position to look at - */ - void lookAt(glm::vec3 position); - - /** - The width divided by the height of the screen/window/viewport - - Incorrect values will make the 3D scene look stretched. - */ - float viewportAspectRatio() const; - void setViewportAspectRatio(float viewportAspectRatio); - - /** A unit vector representing the direction the camera is facing */ - glm::vec3 forward() const; - - /** A unit vector representing the direction to the right of the camera*/ - glm::vec3 right() const; - - /** A unit vector representing the direction out of the top of the camera*/ - glm::vec3 up() const; - - /** - The combined camera transformation matrix, including perspective projection. - - This is the complete matrix to use in the vertex shader. - */ - glm::mat4 matrix() const; - - /** - The perspective projection transformation matrix - */ - glm::mat4 projection() const; - - /** - The translation and rotation matrix of the camera. - - Same as the `matrix` method, except the return value does not include the projection - transformation. - */ - glm::mat4 view() const; - - private: - glm::vec3 _position; - float _horizontalAngle; - float _verticalAngle; - float _fieldOfView; - float _nearPlane; - float _farPlane; - float _viewportAspectRatio; - - void normalizeAngles(); - }; - -} - diff --git a/old/platforms/ios/04_camera/source/tdogl/Program.cpp b/old/platforms/ios/04_camera/source/tdogl/Program.cpp deleted file mode 100644 index d1665d0..0000000 --- a/old/platforms/ios/04_camera/source/tdogl/Program.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - tdogl::Program - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#include "Program.h" -#include -#include - -using namespace tdogl; - -Program::Program(const std::vector& shaders) : - _object(0) -{ - if(shaders.size() <= 0) - throw std::runtime_error("No shaders were provided to create the program"); - - //create the program object - _object = glCreateProgram(); - if(_object == 0) - throw std::runtime_error("glCreateProgram failed"); - - //attach all the shaders - for(unsigned i = 0; i < shaders.size(); ++i) - glAttachShader(_object, shaders[i].object()); - - //link the shaders together - glLinkProgram(_object); - - //detach all the shaders - for(unsigned i = 0; i < shaders.size(); ++i) - glDetachShader(_object, shaders[i].object()); - - //throw exception if linking failed - GLint status; - glGetProgramiv(_object, GL_LINK_STATUS, &status); - if (status == GL_FALSE) { - std::string msg("Program linking failure: "); - - GLint infoLogLength; - glGetProgramiv(_object, GL_INFO_LOG_LENGTH, &infoLogLength); - char* strInfoLog = new char[infoLogLength + 1]; - glGetProgramInfoLog(_object, infoLogLength, NULL, strInfoLog); - msg += strInfoLog; - delete[] strInfoLog; - - glDeleteProgram(_object); _object = 0; - throw std::runtime_error(msg); - } -} - -Program::~Program() { - //might be 0 if ctor fails by throwing exception - if(_object != 0) glDeleteProgram(_object); -} - -GLuint Program::object() const { - return _object; -} - -void Program::use() const { - glUseProgram(_object); -} - -bool Program::isInUse() const { - GLint currentProgram = 0; - glGetIntegerv(GL_CURRENT_PROGRAM, ¤tProgram); - return (currentProgram == (GLint)_object); -} - -void Program::stopUsing() const { - assert(isInUse()); - glUseProgram(0); -} - -GLint Program::attrib(const GLchar* attribName) const { - if(!attribName) - throw std::runtime_error("attribName was NULL"); - - GLint attrib = glGetAttribLocation(_object, attribName); - if(attrib == -1) - throw std::runtime_error(std::string("Program attribute not found: ") + attribName); - - return attrib; -} - -GLint Program::uniform(const GLchar* uniformName) const { - if(!uniformName) - throw std::runtime_error("uniformName was NULL"); - - GLint uniform = glGetUniformLocation(_object, uniformName); - if(uniform == -1) - throw std::runtime_error(std::string("Program uniform not found: ") + uniformName); - - return uniform; -} - -#define ATTRIB_SETTERS(OGL_TYPE, TYPE_PREFIX, TYPE_SUFFIX) \ -\ - void Program::setAttrib(const GLchar* name, OGL_TYPE v0) \ - { assert(isInUse()); glVertexAttrib ## TYPE_PREFIX ## 1 ## TYPE_SUFFIX (attrib(name), v0); } \ - void Program::setAttrib(const GLchar* name, OGL_TYPE v0, OGL_TYPE v1) \ - { assert(isInUse()); glVertexAttrib ## TYPE_PREFIX ## 2 ## TYPE_SUFFIX (attrib(name), v0, v1); } \ - void Program::setAttrib(const GLchar* name, OGL_TYPE v0, OGL_TYPE v1, OGL_TYPE v2) \ - { assert(isInUse()); glVertexAttrib ## TYPE_PREFIX ## 3 ## TYPE_SUFFIX (attrib(name), v0, v1, v2); } \ - void Program::setAttrib(const GLchar* name, OGL_TYPE v0, OGL_TYPE v1, OGL_TYPE v2, OGL_TYPE v3) \ - { assert(isInUse()); glVertexAttrib ## TYPE_PREFIX ## 4 ## TYPE_SUFFIX (attrib(name), v0, v1, v2, v3); } \ -\ - void Program::setAttrib1v(const GLchar* name, const OGL_TYPE* v) \ - { assert(isInUse()); glVertexAttrib ## TYPE_PREFIX ## 1 ## TYPE_SUFFIX ## v (attrib(name), v); } \ - void Program::setAttrib2v(const GLchar* name, const OGL_TYPE* v) \ - { assert(isInUse()); glVertexAttrib ## TYPE_PREFIX ## 2 ## TYPE_SUFFIX ## v (attrib(name), v); } \ - void Program::setAttrib3v(const GLchar* name, const OGL_TYPE* v) \ - { assert(isInUse()); glVertexAttrib ## TYPE_PREFIX ## 3 ## TYPE_SUFFIX ## v (attrib(name), v); } \ - void Program::setAttrib4v(const GLchar* name, const OGL_TYPE* v) \ - { assert(isInUse()); glVertexAttrib ## TYPE_PREFIX ## 4 ## TYPE_SUFFIX ## v (attrib(name), v); } \ - -ATTRIB_SETTERS(GLfloat, , f); -//ATTRIB_N_UNIFORM_SETTERS(double, , d); -//ATTRIB_N_UNIFORM_SETTERS(GLint, I, i); -//ATTRIB_N_UNIFORM_SETTERS(GLuint, I, ui); - - -#define UNIFORM_SETTERS(OGL_TYPE, TYPE_PREFIX, TYPE_SUFFIX) \ - void Program::setUniform(const GLchar* name, OGL_TYPE v0) \ - { assert(isInUse()); glUniform1 ## TYPE_SUFFIX (uniform(name), v0); } \ - void Program::setUniform(const GLchar* name, OGL_TYPE v0, OGL_TYPE v1) \ - { assert(isInUse()); glUniform2 ## TYPE_SUFFIX (uniform(name), v0, v1); } \ - void Program::setUniform(const GLchar* name, OGL_TYPE v0, OGL_TYPE v1, OGL_TYPE v2) \ - { assert(isInUse()); glUniform3 ## TYPE_SUFFIX (uniform(name), v0, v1, v2); } \ - void Program::setUniform(const GLchar* name, OGL_TYPE v0, OGL_TYPE v1, OGL_TYPE v2, OGL_TYPE v3) \ - { assert(isInUse()); glUniform4 ## TYPE_SUFFIX (uniform(name), v0, v1, v2, v3); } \ -\ - void Program::setUniform1v(const GLchar* name, const OGL_TYPE* v, GLsizei count) \ - { assert(isInUse()); glUniform1 ## TYPE_SUFFIX ## v (uniform(name), count, v); } \ - void Program::setUniform2v(const GLchar* name, const OGL_TYPE* v, GLsizei count) \ - { assert(isInUse()); glUniform2 ## TYPE_SUFFIX ## v (uniform(name), count, v); } \ - void Program::setUniform3v(const GLchar* name, const OGL_TYPE* v, GLsizei count) \ - { assert(isInUse()); glUniform3 ## TYPE_SUFFIX ## v (uniform(name), count, v); } \ - void Program::setUniform4v(const GLchar* name, const OGL_TYPE* v, GLsizei count) \ - { assert(isInUse()); glUniform4 ## TYPE_SUFFIX ## v (uniform(name), count, v); } - -UNIFORM_SETTERS(GLfloat, , f); -//ATTRIB_N_UNIFORM_SETTERS(double, , d); -UNIFORM_SETTERS(GLint, I, i); -//ATTRIB_N_UNIFORM_SETTERS(GLuint, I, ui); - -void Program::setUniformMatrix2(const GLchar* name, const GLfloat* v, GLsizei count, GLboolean transpose) { - assert(isInUse()); - glUniformMatrix2fv(uniform(name), count, transpose, v); -} - -void Program::setUniformMatrix3(const GLchar* name, const GLfloat* v, GLsizei count, GLboolean transpose) { - assert(isInUse()); - glUniformMatrix3fv(uniform(name), count, transpose, v); -} - -void Program::setUniformMatrix4(const GLchar* name, const GLfloat* v, GLsizei count, GLboolean transpose) { - assert(isInUse()); - glUniformMatrix4fv(uniform(name), count, transpose, v); -} - -void Program::setUniform(const GLchar* name, const glm::mat2& m, GLboolean transpose) { - assert(isInUse()); - glUniformMatrix2fv(uniform(name), 1, transpose, glm::value_ptr(m)); -} - -void Program::setUniform(const GLchar* name, const glm::mat3& m, GLboolean transpose) { - assert(isInUse()); - glUniformMatrix3fv(uniform(name), 1, transpose, glm::value_ptr(m)); -} - -void Program::setUniform(const GLchar* name, const glm::mat4& m, GLboolean transpose) { - assert(isInUse()); - glUniformMatrix4fv(uniform(name), 1, transpose, glm::value_ptr(m)); -} - -void Program::setUniform(const GLchar* uniformName, const glm::vec3& v) { - setUniform3v(uniformName, glm::value_ptr(v)); -} - -void Program::setUniform(const GLchar* uniformName, const glm::vec4& v) { - setUniform4v(uniformName, glm::value_ptr(v)); -} - - diff --git a/old/platforms/ios/04_camera/source/tdogl/Program.h b/old/platforms/ios/04_camera/source/tdogl/Program.h deleted file mode 100644 index 3997b60..0000000 --- a/old/platforms/ios/04_camera/source/tdogl/Program.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - tdogl::Program - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#pragma once - -#include "Shader.h" -#include -#include - -namespace tdogl { - - /** - Represents an OpenGL program made by linking shaders. - */ - class Program { - public: - /** - Creates a program by linking a list of tdogl::Shader objects - - @param shaders The shaders to link together to make the program - - @throws std::exception if an error occurs. - - @see tdogl::Shader - */ - Program(const std::vector& shaders); - ~Program(); - - - /** - @result The program's object ID, as returned from glCreateProgram - */ - GLuint object() const; - - void use() const; - - bool isInUse() const; - - void stopUsing() const; - - /** - @result The attribute index for the given name, as returned from glGetAttribLocation. - */ - GLint attrib(const GLchar* attribName) const; - - - /** - @result The uniform index for the given name, as returned from glGetUniformLocation. - */ - GLint uniform(const GLchar* uniformName) const; - - /** - Setters for attribute and uniform variables. - - These are convenience methods for the glVertexAttrib* and glUniform* functions. - */ -#define _TDOGL_PROGRAM_ATTRIB_N_UNIFORM_SETTERS(OGL_TYPE) \ - void setAttrib(const GLchar* attribName, OGL_TYPE v0); \ - void setAttrib(const GLchar* attribName, OGL_TYPE v0, OGL_TYPE v1); \ - void setAttrib(const GLchar* attribName, OGL_TYPE v0, OGL_TYPE v1, OGL_TYPE v2); \ - void setAttrib(const GLchar* attribName, OGL_TYPE v0, OGL_TYPE v1, OGL_TYPE v2, OGL_TYPE v3); \ -\ - void setAttrib1v(const GLchar* attribName, const OGL_TYPE* v); \ - void setAttrib2v(const GLchar* attribName, const OGL_TYPE* v); \ - void setAttrib3v(const GLchar* attribName, const OGL_TYPE* v); \ - void setAttrib4v(const GLchar* attribName, const OGL_TYPE* v); \ -\ - void setUniform(const GLchar* uniformName, OGL_TYPE v0); \ - void setUniform(const GLchar* uniformName, OGL_TYPE v0, OGL_TYPE v1); \ - void setUniform(const GLchar* uniformName, OGL_TYPE v0, OGL_TYPE v1, OGL_TYPE v2); \ - void setUniform(const GLchar* uniformName, OGL_TYPE v0, OGL_TYPE v1, OGL_TYPE v2, OGL_TYPE v3); \ -\ - void setUniform1v(const GLchar* uniformName, const OGL_TYPE* v, GLsizei count=1); \ - void setUniform2v(const GLchar* uniformName, const OGL_TYPE* v, GLsizei count=1); \ - void setUniform3v(const GLchar* uniformName, const OGL_TYPE* v, GLsizei count=1); \ - void setUniform4v(const GLchar* uniformName, const OGL_TYPE* v, GLsizei count=1); \ - - _TDOGL_PROGRAM_ATTRIB_N_UNIFORM_SETTERS(GLfloat) - _TDOGL_PROGRAM_ATTRIB_N_UNIFORM_SETTERS(double) - _TDOGL_PROGRAM_ATTRIB_N_UNIFORM_SETTERS(GLint) - _TDOGL_PROGRAM_ATTRIB_N_UNIFORM_SETTERS(GLuint) - - void setUniformMatrix2(const GLchar* uniformName, const GLfloat* v, GLsizei count=1, GLboolean transpose=GL_FALSE); - void setUniformMatrix3(const GLchar* uniformName, const GLfloat* v, GLsizei count=1, GLboolean transpose=GL_FALSE); - void setUniformMatrix4(const GLchar* uniformName, const GLfloat* v, GLsizei count=1, GLboolean transpose=GL_FALSE); - void setUniform(const GLchar* uniformName, const glm::mat2& m, GLboolean transpose=GL_FALSE); - void setUniform(const GLchar* uniformName, const glm::mat3& m, GLboolean transpose=GL_FALSE); - void setUniform(const GLchar* uniformName, const glm::mat4& m, GLboolean transpose=GL_FALSE); - void setUniform(const GLchar* uniformName, const glm::vec3& v); - void setUniform(const GLchar* uniformName, const glm::vec4& v); - - - private: - GLuint _object; - - //copying disabled - Program(const Program&); - const Program& operator=(const Program&); - }; - -} diff --git a/old/platforms/ios/04_camera/source/tdogl/Shader.cpp b/old/platforms/ios/04_camera/source/tdogl/Shader.cpp deleted file mode 100644 index 249eef5..0000000 --- a/old/platforms/ios/04_camera/source/tdogl/Shader.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - tdogl::Shader - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#include "Shader.h" -#include -#include -#include -#include -#include - -using namespace tdogl; - -Shader::Shader(const std::string& shaderCode, GLenum shaderType) : - _object(0), - _refCount(NULL) -{ - //create the shader object - _object = glCreateShader(shaderType); - if(_object == 0) - throw std::runtime_error("glCreateShader failed"); - - //set the source code - const char* code = shaderCode.c_str(); - glShaderSource(_object, 1, (const GLchar**)&code, NULL); - - //compile - glCompileShader(_object); - - //throw exception if compile error occurred - GLint status; - glGetShaderiv(_object, GL_COMPILE_STATUS, &status); - if (status == GL_FALSE) { - std::string msg("Compile failure in shader:\n"); - - GLint infoLogLength; - glGetShaderiv(_object, GL_INFO_LOG_LENGTH, &infoLogLength); - char* strInfoLog = new char[infoLogLength + 1]; - glGetShaderInfoLog(_object, infoLogLength, NULL, strInfoLog); - msg += strInfoLog; - delete[] strInfoLog; - - glDeleteShader(_object); _object = 0; - throw std::runtime_error(msg); - } - - _refCount = new unsigned; - *_refCount = 1; -} - -Shader::Shader(const Shader& other) : - _object(other._object), - _refCount(other._refCount) -{ - _retain(); -} - -Shader::~Shader() { - //_refCount will be NULL if constructor failed and threw an exception - if(_refCount) _release(); -} - -GLuint Shader::object() const { - return _object; -} - -Shader& Shader::operator = (const Shader& other) { - _release(); - _object = other._object; - _refCount = other._refCount; - _retain(); - return *this; -} - -Shader Shader::shaderFromFile(const std::string& filePath, GLenum shaderType) { - //open file - std::ifstream f; - f.open(filePath.c_str(), std::ios::in | std::ios::binary); - if(!f.is_open()){ - throw std::runtime_error(std::string("Failed to open file: ") + filePath); - } - - //read whole file into stringstream buffer - std::stringstream buffer; - buffer << f.rdbuf(); - - //return new shader - Shader shader(buffer.str(), shaderType); - return shader; -} - -void Shader::_retain() { - assert(_refCount); - *_refCount += 1; -} - -void Shader::_release() { - assert(_refCount && *_refCount > 0); - *_refCount -= 1; - if(*_refCount == 0){ - glDeleteShader(_object); _object = 0; - delete _refCount; _refCount = NULL; - } -} - diff --git a/old/platforms/ios/04_camera/source/tdogl/Shader.h b/old/platforms/ios/04_camera/source/tdogl/Shader.h deleted file mode 100644 index c5dcd12..0000000 --- a/old/platforms/ios/04_camera/source/tdogl/Shader.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - tdogl::Shader - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#pragma once - -#include -#include - -namespace tdogl { - - /** - Represents a compiled OpenGL shader. - */ - class Shader { - public: - - /** - Creates a shader from a text file. - - @param filePath The path to the text file containing the shader source. - @param shaderType Same as the argument to glCreateShader. For example GL_VERTEX_SHADER - or GL_FRAGMENT_SHADER. - - @throws std::exception if an error occurs. - */ - static Shader shaderFromFile(const std::string& filePath, GLenum shaderType); - - - /** - Creates a shader from a string of shader source code. - - @param shaderCode The source code for the shader. - @param shaderType Same as the argument to glCreateShader. For example GL_VERTEX_SHADER - or GL_FRAGMENT_SHADER. - - @throws std::exception if an error occurs. - */ - Shader(const std::string& shaderCode, GLenum shaderType); - - - /** - @result The shader's object ID, as returned from glCreateShader - */ - GLuint object() const; - - // tdogl::Shader objects can be copied and assigned because they are reference counted - // like a shared pointer - Shader(const Shader& other); - Shader& operator =(const Shader& other); - ~Shader(); - - private: - GLuint _object; - unsigned* _refCount; - - void _retain(); - void _release(); - }; - -} diff --git a/old/platforms/ios/04_camera/source/tdogl/Texture.cpp b/old/platforms/ios/04_camera/source/tdogl/Texture.cpp deleted file mode 100644 index 4c03d95..0000000 --- a/old/platforms/ios/04_camera/source/tdogl/Texture.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - tdogl::Texture - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#include "Texture.h" -#include - -using namespace tdogl; - -static GLenum TextureFormatForBitmapFormat(Bitmap::Format format) -{ - switch (format) { - case Bitmap::Format_Grayscale: return GL_LUMINANCE; - case Bitmap::Format_GrayscaleAlpha: return GL_LUMINANCE_ALPHA; - case Bitmap::Format_RGB: return GL_RGB; - case Bitmap::Format_RGBA: return GL_RGBA; - default: throw std::runtime_error("Unrecognised Bitmap::Format"); - } -} - -Texture::Texture(const Bitmap& bitmap, GLint minMagFiler, GLint wrapMode) : - _originalWidth((GLfloat)bitmap.width()), - _originalHeight((GLfloat)bitmap.height()) -{ - glGenTextures(1, &_object); - glBindTexture(GL_TEXTURE_2D, _object); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minMagFiler); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, minMagFiler); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapMode); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapMode); - glTexImage2D(GL_TEXTURE_2D, - 0, - TextureFormatForBitmapFormat(bitmap.format()), - (GLsizei)bitmap.width(), - (GLsizei)bitmap.height(), - 0, - TextureFormatForBitmapFormat(bitmap.format()), - GL_UNSIGNED_BYTE, - bitmap.pixelBuffer()); - glBindTexture(GL_TEXTURE_2D, 0); -} - -Texture::~Texture() -{ - glDeleteTextures(1, &_object); -} - -GLuint Texture::object() const -{ - return _object; -} - -GLfloat Texture::originalWidth() const -{ - return _originalWidth; -} - -GLfloat Texture::originalHeight() const -{ - return _originalHeight; -} diff --git a/old/platforms/ios/04_camera/source/tdogl/Texture.h b/old/platforms/ios/04_camera/source/tdogl/Texture.h deleted file mode 100644 index 118a6af..0000000 --- a/old/platforms/ios/04_camera/source/tdogl/Texture.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - tdogl::Texture - - Copyright 2012 Thomas Dalling - http://tomdalling.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#pragma once - -#include -#include "Bitmap.h" - -namespace tdogl { - - /** - Represents an OpenGL texture - */ - class Texture { - public: - /** - Creates a texture from a bitmap. - - The texture will be loaded upside down because tdogl::Bitmap pixel data - is ordered from the top row down, but OpenGL expects the data to - be from the bottom row up. - - @param bitmap The bitmap to load the texture from - @param minMagFiler GL_NEAREST or GL_LINEAR - @param wrapMode GL_REPEAT, GL_MIRRORED_REPEAT, GL_CLAMP_TO_EDGE, or GL_CLAMP_TO_BORDER - */ - Texture(const Bitmap& bitmap, - GLint minMagFiler = GL_LINEAR, - GLint wrapMode = GL_CLAMP_TO_EDGE); - - /** - Deletes the texture object with glDeleteTextures - */ - ~Texture(); - - /** - @result The texure object, as created by glGenTextures - */ - GLuint object() const; - - /** - @result The original width (in pixels) of the bitmap this texture was made from - */ - GLfloat originalWidth() const; - - /** - @result The original height (in pixels) of the bitmap this texture was made from - */ - GLfloat originalHeight() const; - - private: - GLuint _object; - GLfloat _originalWidth; - GLfloat _originalHeight; - - //copying disabled - Texture(const Texture&); - const Texture& operator=(const Texture&); - }; - -} diff --git a/old/platforms/ios/04_camera/sys/01_project_skeleton-Info.plist b/old/platforms/ios/04_camera/sys/01_project_skeleton-Info.plist deleted file mode 100644 index 578f04f..0000000 --- a/old/platforms/ios/04_camera/sys/01_project_skeleton-Info.plist +++ /dev/null @@ -1,47 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - com.whackylabs.test.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIRequiredDeviceCapabilities - - armv7 - - UIStatusBarHidden - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/old/platforms/ios/04_camera/sys/01_project_skeleton-Prefix.pch b/old/platforms/ios/04_camera/sys/01_project_skeleton-Prefix.pch deleted file mode 100644 index 23bdf9c..0000000 --- a/old/platforms/ios/04_camera/sys/01_project_skeleton-Prefix.pch +++ /dev/null @@ -1,14 +0,0 @@ -// -// Prefix header for all source files of the '01_project_skeleton' target in the '01_project_skeleton' project -// - -#import - -#ifndef __IPHONE_5_0 -#warning "This project uses features only available in iOS SDK 5.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/old/platforms/ios/04_camera/sys/Default-568h@2x.png b/old/platforms/ios/04_camera/sys/Default-568h@2x.png deleted file mode 100644 index 0891b7aabfcf3422423b109c8beed2bab838c607..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKb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T zX=u3r>4$fsxP&apbm@Rcbyuc2T=giqZiMo9@9=oua6#YH0hO-1ak9^rJTPMM qY4Yr5Cu^v99p{E9VdroUHKlRW;M8#BJ^AOQE?e9wSHJo8(7yq;BYKSh diff --git a/old/platforms/ios/04_camera/thirdparty/stb_image/stb_image.c b/old/platforms/ios/04_camera/thirdparty/stb_image/stb_image.c deleted file mode 100644 index 8f7e1db..0000000 --- a/old/platforms/ios/04_camera/thirdparty/stb_image/stb_image.c +++ /dev/null @@ -1,4672 +0,0 @@ -/* stbi-1.33 - public domain JPEG/PNG reader - http://nothings.org/stb_image.c - when you control the images you're loading - no warranty implied; use at your own risk - - QUICK NOTES: - Primarily of interest to game developers and other people who can - avoid problematic images and only need the trivial interface - - JPEG baseline (no JPEG progressive) - PNG 8-bit only - - TGA (not sure what subset, if a subset) - BMP non-1bpp, non-RLE - PSD (composited view only, no extra channels) - - GIF (*comp always reports as 4-channel) - HDR (radiance rgbE format) - PIC (Softimage PIC) - - - decode from memory or through FILE (define STBI_NO_STDIO to remove code) - - decode from arbitrary I/O callbacks - - overridable dequantizing-IDCT, YCbCr-to-RGB conversion (define STBI_SIMD) - - Latest revisions: - 1.33 (2011-07-14) minor fixes suggested by Dave Moore - 1.32 (2011-07-13) info support for all filetypes (SpartanJ) - 1.31 (2011-06-19) a few more leak fixes, bug in PNG handling (SpartanJ) - 1.30 (2011-06-11) added ability to load files via io callbacks (Ben Wenger) - 1.29 (2010-08-16) various warning fixes from Aurelien Pocheville - 1.28 (2010-08-01) fix bug in GIF palette transparency (SpartanJ) - 1.27 (2010-08-01) cast-to-uint8 to fix warnings (Laurent Gomila) - allow trailing 0s at end of image data (Laurent Gomila) - 1.26 (2010-07-24) fix bug in file buffering for PNG reported by SpartanJ - - See end of file for full revision history. - - TODO: - stbi_info support for BMP,PSD,HDR,PIC - - - ============================ Contributors ========================= - - Image formats Optimizations & bugfixes - Sean Barrett (jpeg, png, bmp) Fabian "ryg" Giesen - Nicolas Schulz (hdr, psd) - Jonathan Dummer (tga) Bug fixes & warning fixes - Jean-Marc Lienher (gif) Marc LeBlanc - Tom Seddon (pic) Christpher Lloyd - Thatcher Ulrich (psd) Dave Moore - Won Chun - the Horde3D community - Extensions, features Janez Zemva - Jetro Lauha (stbi_info) Jonathan Blow - James "moose2000" Brown (iPhone PNG) Laurent Gomila - Ben "Disch" Wenger (io callbacks) Aruelien Pocheville - Martin "SpartanJ" Golini Ryamond Barbiero - David Woo - - - If your name should be here but isn't, let Sean know. - -*/ - -#ifndef STBI_INCLUDE_STB_IMAGE_H -#define STBI_INCLUDE_STB_IMAGE_H - -// To get a header file for this, either cut and paste the header, -// or create stb_image.h, #define STBI_HEADER_FILE_ONLY, and -// then include stb_image.c from it. - -//// begin header file //////////////////////////////////////////////////// -// -// Limitations: -// - no jpeg progressive support -// - non-HDR formats support 8-bit samples only (jpeg, png) -// - no delayed line count (jpeg) -- IJG doesn't support either -// - no 1-bit BMP -// - GIF always returns *comp=4 -// -// Basic usage (see HDR discussion below): -// int x,y,n; -// unsigned char *data = stbi_load(filename, &x, &y, &n, 0); -// // ... process data if not NULL ... -// // ... x = width, y = height, n = # 8-bit components per pixel ... -// // ... replace '0' with '1'..'4' to force that many components per pixel -// // ... but 'n' will always be the number that it would have been if you said 0 -// stbi_image_free(data) -// -// Standard parameters: -// int *x -- outputs image width in pixels -// int *y -- outputs image height in pixels -// int *comp -- outputs # of image components in image file -// int req_comp -- if non-zero, # of image components requested in result -// -// The return value from an image loader is an 'unsigned char *' which points -// to the pixel data. The pixel data consists of *y scanlines of *x pixels, -// with each pixel consisting of N interleaved 8-bit components; the first -// pixel pointed to is top-left-most in the image. There is no padding between -// image scanlines or between pixels, regardless of format. The number of -// components N is 'req_comp' if req_comp is non-zero, or *comp otherwise. -// If req_comp is non-zero, *comp has the number of components that _would_ -// have been output otherwise. E.g. if you set req_comp to 4, you will always -// get RGBA output, but you can check *comp to easily see if it's opaque. -// -// An output image with N components has the following components interleaved -// in this order in each pixel: -// -// N=#comp components -// 1 grey -// 2 grey, alpha -// 3 red, green, blue -// 4 red, green, blue, alpha -// -// If image loading fails for any reason, the return value will be NULL, -// and *x, *y, *comp will be unchanged. The function stbi_failure_reason() -// can be queried for an extremely brief, end-user unfriendly explanation -// of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid -// compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly -// more user-friendly ones. -// -// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized. -// -// =========================================================================== -// -// iPhone PNG support: -// -// By default we convert iphone-formatted PNGs back to RGB; nominally they -// would silently load as BGR, except the existing code should have just -// failed on such iPhone PNGs. But you can disable this conversion by -// by calling stbi_convert_iphone_png_to_rgb(0), in which case -// you will always just get the native iphone "format" through. -// -// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per -// pixel to remove any premultiplied alpha *only* if the image file explicitly -// says there's premultiplied data (currently only happens in iPhone images, -// and only if iPhone convert-to-rgb processing is on). -// -// =========================================================================== -// -// HDR image support (disable by defining STBI_NO_HDR) -// -// stb_image now supports loading HDR images in general, and currently -// the Radiance .HDR file format, although the support is provided -// generically. You can still load any file through the existing interface; -// if you attempt to load an HDR file, it will be automatically remapped to -// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1; -// both of these constants can be reconfigured through this interface: -// -// stbi_hdr_to_ldr_gamma(2.2f); -// stbi_hdr_to_ldr_scale(1.0f); -// -// (note, do not use _inverse_ constants; stbi_image will invert them -// appropriately). -// -// Additionally, there is a new, parallel interface for loading files as -// (linear) floats to preserve the full dynamic range: -// -// float *data = stbi_loadf(filename, &x, &y, &n, 0); -// -// If you load LDR images through this interface, those images will -// be promoted to floating point values, run through the inverse of -// constants corresponding to the above: -// -// stbi_ldr_to_hdr_scale(1.0f); -// stbi_ldr_to_hdr_gamma(2.2f); -// -// Finally, given a filename (or an open file or memory block--see header -// file for details) containing image data, you can query for the "most -// appropriate" interface to use (that is, whether the image is HDR or -// not), using: -// -// stbi_is_hdr(char *filename); -// -// =========================================================================== -// -// I/O callbacks -// -// I/O callbacks allow you to read from arbitrary sources, like packaged -// files or some other source. Data read from callbacks are processed -// through a small internal buffer (currently 128 bytes) to try to reduce -// overhead. -// -// The three functions you must define are "read" (reads some bytes of data), -// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end). - - -#ifndef STBI_NO_STDIO - -#if defined(_MSC_VER) && _MSC_VER >= 0x1400 -#define _CRT_SECURE_NO_WARNINGS // suppress bogus warnings about fopen() -#endif - -#include -#endif - -#define STBI_VERSION 1 - -enum -{ - STBI_default = 0, // only used for req_comp - - STBI_grey = 1, - STBI_grey_alpha = 2, - STBI_rgb = 3, - STBI_rgb_alpha = 4 -}; - -typedef unsigned char stbi_uc; - -#ifdef __cplusplus -extern "C" { -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// PRIMARY API - works on images of any type -// - -// -// load image by filename, open file, or memory buffer -// - -extern stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); - -#ifndef STBI_NO_STDIO -extern stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp); -extern stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); -// for stbi_load_from_file, file pointer is left pointing immediately after image -#endif - -typedef struct -{ - int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read - void (*skip) (void *user,unsigned n); // skip the next 'n' bytes - int (*eof) (void *user); // returns nonzero if we are at end of file/data -} stbi_io_callbacks; - -extern stbi_uc *stbi_load_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp); - -#ifndef STBI_NO_HDR - extern float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); - - #ifndef STBI_NO_STDIO - extern float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp); - extern float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); - #endif - - extern float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp); - - extern void stbi_hdr_to_ldr_gamma(float gamma); - extern void stbi_hdr_to_ldr_scale(float scale); - - extern void stbi_ldr_to_hdr_gamma(float gamma); - extern void stbi_ldr_to_hdr_scale(float scale); -#endif // STBI_NO_HDR - -// stbi_is_hdr is always defined -extern int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user); -extern int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len); -#ifndef STBI_NO_STDIO -extern int stbi_is_hdr (char const *filename); -extern int stbi_is_hdr_from_file(FILE *f); -#endif // STBI_NO_STDIO - - -// get a VERY brief reason for failure -// NOT THREADSAFE -extern const char *stbi_failure_reason (void); - -// free the loaded image -- this is just free() -extern void stbi_image_free (void *retval_from_stbi_load); - -// get image dimensions & components without fully decoding -extern int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); -extern int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp); - -#ifndef STBI_NO_STDIO -extern int stbi_info (char const *filename, int *x, int *y, int *comp); -extern int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); - -#endif - - - -// for image formats that explicitly notate that they have premultiplied alpha, -// we just return the colors as stored in the file. set this flag to force -// unpremultiplication. results are undefined if the unpremultiply overflow. -extern void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply); - -// indicate whether we should process iphone images back to canonical format, -// or just pass them through "as-is" -extern void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert); - - -// ZLIB client - used by PNG, available for other purposes - -extern char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen); -extern char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen); -extern int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); - -extern char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen); -extern int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); - - -// define faster low-level operations (typically SIMD support) -#ifdef STBI_SIMD -typedef void (*stbi_idct_8x8)(stbi_uc *out, int out_stride, short data[64], unsigned short *dequantize); -// compute an integer IDCT on "input" -// input[x] = data[x] * dequantize[x] -// write results to 'out': 64 samples, each run of 8 spaced by 'out_stride' -// CLAMP results to 0..255 -typedef void (*stbi_YCbCr_to_RGB_run)(stbi_uc *output, stbi_uc const *y, stbi_uc const *cb, stbi_uc const *cr, int count, int step); -// compute a conversion from YCbCr to RGB -// 'count' pixels -// write pixels to 'output'; each pixel is 'step' bytes (either 3 or 4; if 4, write '255' as 4th), order R,G,B -// y: Y input channel -// cb: Cb input channel; scale/biased to be 0..255 -// cr: Cr input channel; scale/biased to be 0..255 - -extern void stbi_install_idct(stbi_idct_8x8 func); -extern void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func); -#endif // STBI_SIMD - - -#ifdef __cplusplus -} -#endif - -// -// -//// end header file ///////////////////////////////////////////////////// -#endif // STBI_INCLUDE_STB_IMAGE_H - -#ifndef STBI_HEADER_FILE_ONLY - -#ifndef STBI_NO_HDR -#include // ldexp -#include // strcmp, strtok -#endif - -#ifndef STBI_NO_STDIO -#include -#endif -#include -#include -#include -#include - -#ifndef _MSC_VER - #ifdef __cplusplus - #define stbi_inline inline - #else - #define stbi_inline - #endif -#else - #define stbi_inline __forceinline -#endif - - -// implementation: -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef signed short int16; -typedef unsigned int uint32; -typedef signed int int32; -typedef unsigned int uint; - -// should produce compiler error if size is wrong -typedef unsigned char validate_uint32[sizeof(uint32)==4 ? 1 : -1]; - -#if defined(STBI_NO_STDIO) && !defined(STBI_NO_WRITE) -#define STBI_NO_WRITE -#endif - -#define STBI_NOTUSED(v) (void)sizeof(v) - -#ifdef _MSC_VER -#define STBI_HAS_LROTL -#endif - -#ifdef STBI_HAS_LROTL - #define stbi_lrot(x,y) _lrotl(x,y) -#else - #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y)))) -#endif - -/////////////////////////////////////////////// -// -// stbi struct and start_xxx functions - -// stbi structure is our basic context used by all images, so it -// contains all the IO context, plus some basic image information -typedef struct -{ - uint32 img_x, img_y; - int img_n, img_out_n; - - stbi_io_callbacks io; - void *io_user_data; - - int read_from_callbacks; - int buflen; - uint8 buffer_start[128]; - - uint8 *img_buffer, *img_buffer_end; - uint8 *img_buffer_original; -} stbi; - - -static void refill_buffer(stbi *s); - -// initialize a memory-decode context -static void start_mem(stbi *s, uint8 const *buffer, int len) -{ - s->io.read = NULL; - s->read_from_callbacks = 0; - s->img_buffer = s->img_buffer_original = (uint8 *) buffer; - s->img_buffer_end = (uint8 *) buffer+len; -} - -// initialize a callback-based context -static void start_callbacks(stbi *s, stbi_io_callbacks *c, void *user) -{ - s->io = *c; - s->io_user_data = user; - s->buflen = sizeof(s->buffer_start); - s->read_from_callbacks = 1; - s->img_buffer_original = s->buffer_start; - refill_buffer(s); -} - -#ifndef STBI_NO_STDIO - -static int stdio_read(void *user, char *data, int size) -{ - return (int) fread(data,1,size,(FILE*) user); -} - -static void stdio_skip(void *user, unsigned n) -{ - fseek((FILE*) user, n, SEEK_CUR); -} - -static int stdio_eof(void *user) -{ - return feof((FILE*) user); -} - -static stbi_io_callbacks stbi_stdio_callbacks = -{ - stdio_read, - stdio_skip, - stdio_eof, -}; - -static void start_file(stbi *s, FILE *f) -{ - start_callbacks(s, &stbi_stdio_callbacks, (void *) f); -} - -//static void stop_file(stbi *s) { } - -#endif // !STBI_NO_STDIO - -static void stbi_rewind(stbi *s) -{ - // conceptually rewind SHOULD rewind to the beginning of the stream, - // but we just rewind to the beginning of the initial buffer, because - // we only use it after doing 'test', which only ever looks at at most 92 bytes - s->img_buffer = s->img_buffer_original; -} - -static int stbi_jpeg_test(stbi *s); -static stbi_uc *stbi_jpeg_load(stbi *s, int *x, int *y, int *comp, int req_comp); -static int stbi_jpeg_info(stbi *s, int *x, int *y, int *comp); -static int stbi_png_test(stbi *s); -static stbi_uc *stbi_png_load(stbi *s, int *x, int *y, int *comp, int req_comp); -static int stbi_png_info(stbi *s, int *x, int *y, int *comp); -static int stbi_bmp_test(stbi *s); -static stbi_uc *stbi_bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp); -static int stbi_tga_test(stbi *s); -static stbi_uc *stbi_tga_load(stbi *s, int *x, int *y, int *comp, int req_comp); -static int stbi_tga_info(stbi *s, int *x, int *y, int *comp); -static int stbi_psd_test(stbi *s); -static stbi_uc *stbi_psd_load(stbi *s, int *x, int *y, int *comp, int req_comp); -static int stbi_hdr_test(stbi *s); -static float *stbi_hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp); -static int stbi_pic_test(stbi *s); -static stbi_uc *stbi_pic_load(stbi *s, int *x, int *y, int *comp, int req_comp); -static int stbi_gif_test(stbi *s); -static stbi_uc *stbi_gif_load(stbi *s, int *x, int *y, int *comp, int req_comp); -static int stbi_gif_info(stbi *s, int *x, int *y, int *comp); - - -// this is not threadsafe -static const char *failure_reason; - -const char *stbi_failure_reason(void) -{ - return failure_reason; -} - -static int e(const char *str) -{ - failure_reason = str; - return 0; -} - -// e - error -// epf - error returning pointer to float -// epuc - error returning pointer to unsigned char - -#ifdef STBI_NO_FAILURE_STRINGS - #define e(x,y) 0 -#elif defined(STBI_FAILURE_USERMSG) - #define e(x,y) e(y) -#else - #define e(x,y) e(x) -#endif - -#define epf(x,y) ((float *) (e(x,y)?NULL:NULL)) -#define epuc(x,y) ((unsigned char *) (e(x,y)?NULL:NULL)) - -void stbi_image_free(void *retval_from_stbi_load) -{ - free(retval_from_stbi_load); -} - -#ifndef STBI_NO_HDR -static float *ldr_to_hdr(stbi_uc *data, int x, int y, int comp); -static stbi_uc *hdr_to_ldr(float *data, int x, int y, int comp); -#endif - -static unsigned char *stbi_load_main(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - if (stbi_jpeg_test(s)) return stbi_jpeg_load(s,x,y,comp,req_comp); - if (stbi_png_test(s)) return stbi_png_load(s,x,y,comp,req_comp); - if (stbi_bmp_test(s)) return stbi_bmp_load(s,x,y,comp,req_comp); - if (stbi_gif_test(s)) return stbi_gif_load(s,x,y,comp,req_comp); - if (stbi_psd_test(s)) return stbi_psd_load(s,x,y,comp,req_comp); - if (stbi_pic_test(s)) return stbi_pic_load(s,x,y,comp,req_comp); - - #ifndef STBI_NO_HDR - if (stbi_hdr_test(s)) { - float *hdr = stbi_hdr_load(s, x,y,comp,req_comp); - return hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp); - } - #endif - - // test tga last because it's a crappy test! - if (stbi_tga_test(s)) - return stbi_tga_load(s,x,y,comp,req_comp); - return epuc("unknown image type", "Image not of any known type, or corrupt"); -} - -#ifndef STBI_NO_STDIO -unsigned char *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp) -{ - FILE *f = fopen(filename, "rb"); - unsigned char *result; - if (!f) return epuc("can't fopen", "Unable to open file"); - result = stbi_load_from_file(f,x,y,comp,req_comp); - fclose(f); - return result; -} - -unsigned char *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) -{ - stbi s; - start_file(&s,f); - return stbi_load_main(&s,x,y,comp,req_comp); -} -#endif //!STBI_NO_STDIO - -unsigned char *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) -{ - stbi s; - start_mem(&s,buffer,len); - return stbi_load_main(&s,x,y,comp,req_comp); -} - -unsigned char *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) -{ - stbi s; - start_callbacks(&s, (stbi_io_callbacks *) clbk, user); - return stbi_load_main(&s,x,y,comp,req_comp); -} - -#ifndef STBI_NO_HDR - -float *stbi_loadf_main(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - unsigned char *data; - #ifndef STBI_NO_HDR - if (stbi_hdr_test(s)) - return stbi_hdr_load(s,x,y,comp,req_comp); - #endif - data = stbi_load_main(s, x, y, comp, req_comp); - if (data) - return ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); - return epf("unknown image type", "Image not of any known type, or corrupt"); -} - -float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) -{ - stbi s; - start_mem(&s,buffer,len); - return stbi_loadf_main(&s,x,y,comp,req_comp); -} - -float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) -{ - stbi s; - start_callbacks(&s, (stbi_io_callbacks *) clbk, user); - return stbi_loadf_main(&s,x,y,comp,req_comp); -} - -#ifndef STBI_NO_STDIO -float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp) -{ - FILE *f = fopen(filename, "rb"); - float *result; - if (!f) return epf("can't fopen", "Unable to open file"); - result = stbi_loadf_from_file(f,x,y,comp,req_comp); - fclose(f); - return result; -} - -float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) -{ - stbi s; - start_file(&s,f); - return stbi_loadf_main(&s,x,y,comp,req_comp); -} -#endif // !STBI_NO_STDIO - -#endif // !STBI_NO_HDR - -// these is-hdr-or-not is defined independent of whether STBI_NO_HDR is -// defined, for API simplicity; if STBI_NO_HDR is defined, it always -// reports false! - -int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len) -{ - #ifndef STBI_NO_HDR - stbi s; - start_mem(&s,buffer,len); - return stbi_hdr_test(&s); - #else - STBI_NOTUSED(buffer); - STBI_NOTUSED(len); - return 0; - #endif -} - -#ifndef STBI_NO_STDIO -extern int stbi_is_hdr (char const *filename) -{ - FILE *f = fopen(filename, "rb"); - int result=0; - if (f) { - result = stbi_is_hdr_from_file(f); - fclose(f); - } - return result; -} - -extern int stbi_is_hdr_from_file(FILE *f) -{ - #ifndef STBI_NO_HDR - stbi s; - start_file(&s,f); - return stbi_hdr_test(&s); - #else - return 0; - #endif -} -#endif // !STBI_NO_STDIO - -extern int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user) -{ - #ifndef STBI_NO_HDR - stbi s; - start_callbacks(&s, (stbi_io_callbacks *) clbk, user); - return stbi_hdr_test(&s); - #else - return 0; - #endif -} - -#ifndef STBI_NO_HDR -static float h2l_gamma_i=1.0f/2.2f, h2l_scale_i=1.0f; -static float l2h_gamma=2.2f, l2h_scale=1.0f; - -void stbi_hdr_to_ldr_gamma(float gamma) { h2l_gamma_i = 1/gamma; } -void stbi_hdr_to_ldr_scale(float scale) { h2l_scale_i = 1/scale; } - -void stbi_ldr_to_hdr_gamma(float gamma) { l2h_gamma = gamma; } -void stbi_ldr_to_hdr_scale(float scale) { l2h_scale = scale; } -#endif - - -////////////////////////////////////////////////////////////////////////////// -// -// Common code used by all image loaders -// - -enum -{ - SCAN_load=0, - SCAN_type, - SCAN_header -}; - -static void refill_buffer(stbi *s) -{ - int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen); - if (n == 0) { - // at end of file, treat same as if from memory - s->read_from_callbacks = 0; - s->img_buffer = s->img_buffer_end-1; - *s->img_buffer = 0; - } else { - s->img_buffer = s->buffer_start; - s->img_buffer_end = s->buffer_start + n; - } -} - -stbi_inline static int get8(stbi *s) -{ - if (s->img_buffer < s->img_buffer_end) - return *s->img_buffer++; - if (s->read_from_callbacks) { - refill_buffer(s); - return *s->img_buffer++; - } - return 0; -} - -stbi_inline static int at_eof(stbi *s) -{ - if (s->io.read) { - if (!(s->io.eof)(s->io_user_data)) return 0; - // if feof() is true, check if buffer = end - // special case: we've only got the special 0 character at the end - if (s->read_from_callbacks == 0) return 1; - } - - return s->img_buffer >= s->img_buffer_end; -} - -stbi_inline static uint8 get8u(stbi *s) -{ - return (uint8) get8(s); -} - -static void skip(stbi *s, int n) -{ - if (s->io.read) { - int blen = s->img_buffer_end - s->img_buffer; - if (blen < n) { - s->img_buffer = s->img_buffer_end; - (s->io.skip)(s->io_user_data, n - blen); - return; - } - } - s->img_buffer += n; -} - -static int getn(stbi *s, stbi_uc *buffer, int n) -{ - if (s->io.read) { - int blen = s->img_buffer_end - s->img_buffer; - if (blen < n) { - int res, count; - - memcpy(buffer, s->img_buffer, blen); - - count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen); - res = (count == (n-blen)); - s->img_buffer = s->img_buffer_end; - return res; - } - } - - if (s->img_buffer+n <= s->img_buffer_end) { - memcpy(buffer, s->img_buffer, n); - s->img_buffer += n; - return 1; - } else - return 0; -} - -static int get16(stbi *s) -{ - int z = get8(s); - return (z << 8) + get8(s); -} - -static uint32 get32(stbi *s) -{ - uint32 z = get16(s); - return (z << 16) + get16(s); -} - -static int get16le(stbi *s) -{ - int z = get8(s); - return z + (get8(s) << 8); -} - -static uint32 get32le(stbi *s) -{ - uint32 z = get16le(s); - return z + (get16le(s) << 16); -} - -////////////////////////////////////////////////////////////////////////////// -// -// generic converter from built-in img_n to req_comp -// individual types do this automatically as much as possible (e.g. jpeg -// does all cases internally since it needs to colorspace convert anyway, -// and it never has alpha, so very few cases ). png can automatically -// interleave an alpha=255 channel, but falls back to this for other cases -// -// assume data buffer is malloced, so malloc a new one and free that one -// only failure mode is malloc failing - -static uint8 compute_y(int r, int g, int b) -{ - return (uint8) (((r*77) + (g*150) + (29*b)) >> 8); -} - -static unsigned char *convert_format(unsigned char *data, int img_n, int req_comp, uint x, uint y) -{ - int i,j; - unsigned char *good; - - if (req_comp == img_n) return data; - assert(req_comp >= 1 && req_comp <= 4); - - good = (unsigned char *) malloc(req_comp * x * y); - if (good == NULL) { - free(data); - return epuc("outofmem", "Out of memory"); - } - - for (j=0; j < (int) y; ++j) { - unsigned char *src = data + j * x * img_n ; - unsigned char *dest = good + j * x * req_comp; - - #define COMBO(a,b) ((a)*8+(b)) - #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) - // convert source image with img_n components to one with req_comp components; - // avoid switch per pixel, so use switch per scanline and massive macros - switch (COMBO(img_n, req_comp)) { - CASE(1,2) dest[0]=src[0], dest[1]=255; break; - CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break; - CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break; - CASE(2,1) dest[0]=src[0]; break; - CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break; - CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break; - CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break; - CASE(3,1) dest[0]=compute_y(src[0],src[1],src[2]); break; - CASE(3,2) dest[0]=compute_y(src[0],src[1],src[2]), dest[1] = 255; break; - CASE(4,1) dest[0]=compute_y(src[0],src[1],src[2]); break; - CASE(4,2) dest[0]=compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break; - CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break; - default: assert(0); - } - #undef CASE - } - - free(data); - return good; -} - -#ifndef STBI_NO_HDR -static float *ldr_to_hdr(stbi_uc *data, int x, int y, int comp) -{ - int i,k,n; - float *output = (float *) malloc(x * y * comp * sizeof(float)); - if (output == NULL) { free(data); return epf("outofmem", "Out of memory"); } - // compute number of non-alpha components - if (comp & 1) n = comp; else n = comp-1; - for (i=0; i < x*y; ++i) { - for (k=0; k < n; ++k) { - output[i*comp + k] = (float) pow(data[i*comp+k]/255.0f, l2h_gamma) * l2h_scale; - } - if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f; - } - free(data); - return output; -} - -#define float2int(x) ((int) (x)) -static stbi_uc *hdr_to_ldr(float *data, int x, int y, int comp) -{ - int i,k,n; - stbi_uc *output = (stbi_uc *) malloc(x * y * comp); - if (output == NULL) { free(data); return epuc("outofmem", "Out of memory"); } - // compute number of non-alpha components - if (comp & 1) n = comp; else n = comp-1; - for (i=0; i < x*y; ++i) { - for (k=0; k < n; ++k) { - float z = (float) pow(data[i*comp+k]*h2l_scale_i, h2l_gamma_i) * 255 + 0.5f; - if (z < 0) z = 0; - if (z > 255) z = 255; - output[i*comp + k] = (uint8) float2int(z); - } - if (k < comp) { - float z = data[i*comp+k] * 255 + 0.5f; - if (z < 0) z = 0; - if (z > 255) z = 255; - output[i*comp + k] = (uint8) float2int(z); - } - } - free(data); - return output; -} -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// "baseline" JPEG/JFIF decoder (not actually fully baseline implementation) -// -// simple implementation -// - channel subsampling of at most 2 in each dimension -// - doesn't support delayed output of y-dimension -// - simple interface (only one output format: 8-bit interleaved RGB) -// - doesn't try to recover corrupt jpegs -// - doesn't allow partial loading, loading multiple at once -// - still fast on x86 (copying globals into locals doesn't help x86) -// - allocates lots of intermediate memory (full size of all components) -// - non-interleaved case requires this anyway -// - allows good upsampling (see next) -// high-quality -// - upsampled channels are bilinearly interpolated, even across blocks -// - quality integer IDCT derived from IJG's 'slow' -// performance -// - fast huffman; reasonable integer IDCT -// - uses a lot of intermediate memory, could cache poorly -// - load http://nothings.org/remote/anemones.jpg 3 times on 2.8Ghz P4 -// stb_jpeg: 1.34 seconds (MSVC6, default release build) -// stb_jpeg: 1.06 seconds (MSVC6, processor = Pentium Pro) -// IJL11.dll: 1.08 seconds (compiled by intel) -// IJG 1998: 0.98 seconds (MSVC6, makefile provided by IJG) -// IJG 1998: 0.95 seconds (MSVC6, makefile + proc=PPro) - -// huffman decoding acceleration -#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache - -typedef struct -{ - uint8 fast[1 << FAST_BITS]; - // weirdly, repacking this into AoS is a 10% speed loss, instead of a win - uint16 code[256]; - uint8 values[256]; - uint8 size[257]; - unsigned int maxcode[18]; - int delta[17]; // old 'firstsymbol' - old 'firstcode' -} huffman; - -typedef struct -{ - #ifdef STBI_SIMD - unsigned short dequant2[4][64]; - #endif - stbi *s; - huffman huff_dc[4]; - huffman huff_ac[4]; - uint8 dequant[4][64]; - -// sizes for components, interleaved MCUs - int img_h_max, img_v_max; - int img_mcu_x, img_mcu_y; - int img_mcu_w, img_mcu_h; - -// definition of jpeg image component - struct - { - int id; - int h,v; - int tq; - int hd,ha; - int dc_pred; - - int x,y,w2,h2; - uint8 *data; - void *raw_data; - uint8 *linebuf; - } img_comp[4]; - - uint32 code_buffer; // jpeg entropy-coded buffer - int code_bits; // number of valid bits - unsigned char marker; // marker seen while filling entropy buffer - int nomore; // flag if we saw a marker so must stop - - int scan_n, order[4]; - int restart_interval, todo; -} jpeg; - -static int build_huffman(huffman *h, int *count) -{ - int i,j,k=0,code; - // build size list for each symbol (from JPEG spec) - for (i=0; i < 16; ++i) - for (j=0; j < count[i]; ++j) - h->size[k++] = (uint8) (i+1); - h->size[k] = 0; - - // compute actual symbols (from jpeg spec) - code = 0; - k = 0; - for(j=1; j <= 16; ++j) { - // compute delta to add to code to compute symbol id - h->delta[j] = k - code; - if (h->size[k] == j) { - while (h->size[k] == j) - h->code[k++] = (uint16) (code++); - if (code-1 >= (1 << j)) return e("bad code lengths","Corrupt JPEG"); - } - // compute largest code + 1 for this size, preshifted as needed later - h->maxcode[j] = code << (16-j); - code <<= 1; - } - h->maxcode[j] = 0xffffffff; - - // build non-spec acceleration table; 255 is flag for not-accelerated - memset(h->fast, 255, 1 << FAST_BITS); - for (i=0; i < k; ++i) { - int s = h->size[i]; - if (s <= FAST_BITS) { - int c = h->code[i] << (FAST_BITS-s); - int m = 1 << (FAST_BITS-s); - for (j=0; j < m; ++j) { - h->fast[c+j] = (uint8) i; - } - } - } - return 1; -} - -static void grow_buffer_unsafe(jpeg *j) -{ - do { - int b = j->nomore ? 0 : get8(j->s); - if (b == 0xff) { - int c = get8(j->s); - if (c != 0) { - j->marker = (unsigned char) c; - j->nomore = 1; - return; - } - } - j->code_buffer |= b << (24 - j->code_bits); - j->code_bits += 8; - } while (j->code_bits <= 24); -} - -// (1 << n) - 1 -static uint32 bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535}; - -// decode a jpeg huffman value from the bitstream -stbi_inline static int decode(jpeg *j, huffman *h) -{ - unsigned int temp; - int c,k; - - if (j->code_bits < 16) grow_buffer_unsafe(j); - - // look at the top FAST_BITS and determine what symbol ID it is, - // if the code is <= FAST_BITS - c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); - k = h->fast[c]; - if (k < 255) { - int s = h->size[k]; - if (s > j->code_bits) - return -1; - j->code_buffer <<= s; - j->code_bits -= s; - return h->values[k]; - } - - // naive test is to shift the code_buffer down so k bits are - // valid, then test against maxcode. To speed this up, we've - // preshifted maxcode left so that it has (16-k) 0s at the - // end; in other words, regardless of the number of bits, it - // wants to be compared against something shifted to have 16; - // that way we don't need to shift inside the loop. - temp = j->code_buffer >> 16; - for (k=FAST_BITS+1 ; ; ++k) - if (temp < h->maxcode[k]) - break; - if (k == 17) { - // error! code not found - j->code_bits -= 16; - return -1; - } - - if (k > j->code_bits) - return -1; - - // convert the huffman code to the symbol id - c = ((j->code_buffer >> (32 - k)) & bmask[k]) + h->delta[k]; - assert((((j->code_buffer) >> (32 - h->size[c])) & bmask[h->size[c]]) == h->code[c]); - - // convert the id to a symbol - j->code_bits -= k; - j->code_buffer <<= k; - return h->values[c]; -} - -// combined JPEG 'receive' and JPEG 'extend', since baseline -// always extends everything it receives. -stbi_inline static int extend_receive(jpeg *j, int n) -{ - unsigned int m = 1 << (n-1); - unsigned int k; - if (j->code_bits < n) grow_buffer_unsafe(j); - - #if 1 - k = stbi_lrot(j->code_buffer, n); - j->code_buffer = k & ~bmask[n]; - k &= bmask[n]; - j->code_bits -= n; - #else - k = (j->code_buffer >> (32 - n)) & bmask[n]; - j->code_bits -= n; - j->code_buffer <<= n; - #endif - // the following test is probably a random branch that won't - // predict well. I tried to table accelerate it but failed. - // maybe it's compiling as a conditional move? - if (k < m) - return (-1 << n) + k + 1; - else - return k; -} - -// given a value that's at position X in the zigzag stream, -// where does it appear in the 8x8 matrix coded as row-major? -static uint8 dezigzag[64+15] = -{ - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63, - // let corrupt input sample past end - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63 -}; - -// decode one 64-entry block-- -static int decode_block(jpeg *j, short data[64], huffman *hdc, huffman *hac, int b) -{ - int diff,dc,k; - int t = decode(j, hdc); - if (t < 0) return e("bad huffman code","Corrupt JPEG"); - - // 0 all the ac values now so we can do it 32-bits at a time - memset(data,0,64*sizeof(data[0])); - - diff = t ? extend_receive(j, t) : 0; - dc = j->img_comp[b].dc_pred + diff; - j->img_comp[b].dc_pred = dc; - data[0] = (short) dc; - - // decode AC components, see JPEG spec - k = 1; - do { - int r,s; - int rs = decode(j, hac); - if (rs < 0) return e("bad huffman code","Corrupt JPEG"); - s = rs & 15; - r = rs >> 4; - if (s == 0) { - if (rs != 0xf0) break; // end block - k += 16; - } else { - k += r; - // decode into unzigzag'd location - data[dezigzag[k++]] = (short) extend_receive(j,s); - } - } while (k < 64); - return 1; -} - -// take a -128..127 value and clamp it and convert to 0..255 -stbi_inline static uint8 clamp(int x) -{ - // trick to use a single test to catch both cases - if ((unsigned int) x > 255) { - if (x < 0) return 0; - if (x > 255) return 255; - } - return (uint8) x; -} - -#define f2f(x) (int) (((x) * 4096 + 0.5)) -#define fsh(x) ((x) << 12) - -// derived from jidctint -- DCT_ISLOW -#define IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \ - int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \ - p2 = s2; \ - p3 = s6; \ - p1 = (p2+p3) * f2f(0.5411961f); \ - t2 = p1 + p3*f2f(-1.847759065f); \ - t3 = p1 + p2*f2f( 0.765366865f); \ - p2 = s0; \ - p3 = s4; \ - t0 = fsh(p2+p3); \ - t1 = fsh(p2-p3); \ - x0 = t0+t3; \ - x3 = t0-t3; \ - x1 = t1+t2; \ - x2 = t1-t2; \ - t0 = s7; \ - t1 = s5; \ - t2 = s3; \ - t3 = s1; \ - p3 = t0+t2; \ - p4 = t1+t3; \ - p1 = t0+t3; \ - p2 = t1+t2; \ - p5 = (p3+p4)*f2f( 1.175875602f); \ - t0 = t0*f2f( 0.298631336f); \ - t1 = t1*f2f( 2.053119869f); \ - t2 = t2*f2f( 3.072711026f); \ - t3 = t3*f2f( 1.501321110f); \ - p1 = p5 + p1*f2f(-0.899976223f); \ - p2 = p5 + p2*f2f(-2.562915447f); \ - p3 = p3*f2f(-1.961570560f); \ - p4 = p4*f2f(-0.390180644f); \ - t3 += p1+p4; \ - t2 += p2+p3; \ - t1 += p2+p4; \ - t0 += p1+p3; - -#ifdef STBI_SIMD -typedef unsigned short stbi_dequantize_t; -#else -typedef uint8 stbi_dequantize_t; -#endif - -// .344 seconds on 3*anemones.jpg -static void idct_block(uint8 *out, int out_stride, short data[64], stbi_dequantize_t *dequantize) -{ - int i,val[64],*v=val; - stbi_dequantize_t *dq = dequantize; - uint8 *o; - short *d = data; - - // columns - for (i=0; i < 8; ++i,++d,++dq, ++v) { - // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing - if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0 - && d[40]==0 && d[48]==0 && d[56]==0) { - // no shortcut 0 seconds - // (1|2|3|4|5|6|7)==0 0 seconds - // all separate -0.047 seconds - // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds - int dcterm = d[0] * dq[0] << 2; - v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm; - } else { - IDCT_1D(d[ 0]*dq[ 0],d[ 8]*dq[ 8],d[16]*dq[16],d[24]*dq[24], - d[32]*dq[32],d[40]*dq[40],d[48]*dq[48],d[56]*dq[56]) - // constants scaled things up by 1<<12; let's bring them back - // down, but keep 2 extra bits of precision - x0 += 512; x1 += 512; x2 += 512; x3 += 512; - v[ 0] = (x0+t3) >> 10; - v[56] = (x0-t3) >> 10; - v[ 8] = (x1+t2) >> 10; - v[48] = (x1-t2) >> 10; - v[16] = (x2+t1) >> 10; - v[40] = (x2-t1) >> 10; - v[24] = (x3+t0) >> 10; - v[32] = (x3-t0) >> 10; - } - } - - for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) { - // no fast case since the first 1D IDCT spread components out - IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7]) - // constants scaled things up by 1<<12, plus we had 1<<2 from first - // loop, plus horizontal and vertical each scale by sqrt(8) so together - // we've got an extra 1<<3, so 1<<17 total we need to remove. - // so we want to round that, which means adding 0.5 * 1<<17, - // aka 65536. Also, we'll end up with -128 to 127 that we want - // to encode as 0..255 by adding 128, so we'll add that before the shift - x0 += 65536 + (128<<17); - x1 += 65536 + (128<<17); - x2 += 65536 + (128<<17); - x3 += 65536 + (128<<17); - // tried computing the shifts into temps, or'ing the temps to see - // if any were out of range, but that was slower - o[0] = clamp((x0+t3) >> 17); - o[7] = clamp((x0-t3) >> 17); - o[1] = clamp((x1+t2) >> 17); - o[6] = clamp((x1-t2) >> 17); - o[2] = clamp((x2+t1) >> 17); - o[5] = clamp((x2-t1) >> 17); - o[3] = clamp((x3+t0) >> 17); - o[4] = clamp((x3-t0) >> 17); - } -} - -#ifdef STBI_SIMD -static stbi_idct_8x8 stbi_idct_installed = idct_block; - -void stbi_install_idct(stbi_idct_8x8 func) -{ - stbi_idct_installed = func; -} -#endif - -#define MARKER_none 0xff -// if there's a pending marker from the entropy stream, return that -// otherwise, fetch from the stream and get a marker. if there's no -// marker, return 0xff, which is never a valid marker value -static uint8 get_marker(jpeg *j) -{ - uint8 x; - if (j->marker != MARKER_none) { x = j->marker; j->marker = MARKER_none; return x; } - x = get8u(j->s); - if (x != 0xff) return MARKER_none; - while (x == 0xff) - x = get8u(j->s); - return x; -} - -// in each scan, we'll have scan_n components, and the order -// of the components is specified by order[] -#define RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7) - -// after a restart interval, reset the entropy decoder and -// the dc prediction -static void reset(jpeg *j) -{ - j->code_bits = 0; - j->code_buffer = 0; - j->nomore = 0; - j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0; - j->marker = MARKER_none; - j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff; - // no more than 1<<31 MCUs if no restart_interal? that's plenty safe, - // since we don't even allow 1<<30 pixels -} - -static int parse_entropy_coded_data(jpeg *z) -{ - reset(z); - if (z->scan_n == 1) { - int i,j; - #ifdef STBI_SIMD - __declspec(align(16)) - #endif - short data[64]; - int n = z->order[0]; - // non-interleaved data, we just need to process one block at a time, - // in trivial scanline order - // number of blocks to do just depends on how many actual "pixels" this - // component has, independent of interleaved MCU blocking and such - int w = (z->img_comp[n].x+7) >> 3; - int h = (z->img_comp[n].y+7) >> 3; - for (j=0; j < h; ++j) { - for (i=0; i < w; ++i) { - if (!decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+z->img_comp[n].ha, n)) return 0; - #ifdef STBI_SIMD - stbi_idct_installed(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data, z->dequant2[z->img_comp[n].tq]); - #else - idct_block(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data, z->dequant[z->img_comp[n].tq]); - #endif - // every data block is an MCU, so countdown the restart interval - if (--z->todo <= 0) { - if (z->code_bits < 24) grow_buffer_unsafe(z); - // if it's NOT a restart, then just bail, so we get corrupt data - // rather than no data - if (!RESTART(z->marker)) return 1; - reset(z); - } - } - } - } else { // interleaved! - int i,j,k,x,y; - short data[64]; - for (j=0; j < z->img_mcu_y; ++j) { - for (i=0; i < z->img_mcu_x; ++i) { - // scan an interleaved mcu... process scan_n components in order - for (k=0; k < z->scan_n; ++k) { - int n = z->order[k]; - // scan out an mcu's worth of this component; that's just determined - // by the basic H and V specified for the component - for (y=0; y < z->img_comp[n].v; ++y) { - for (x=0; x < z->img_comp[n].h; ++x) { - int x2 = (i*z->img_comp[n].h + x)*8; - int y2 = (j*z->img_comp[n].v + y)*8; - if (!decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+z->img_comp[n].ha, n)) return 0; - #ifdef STBI_SIMD - stbi_idct_installed(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data, z->dequant2[z->img_comp[n].tq]); - #else - idct_block(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data, z->dequant[z->img_comp[n].tq]); - #endif - } - } - } - // after all interleaved components, that's an interleaved MCU, - // so now count down the restart interval - if (--z->todo <= 0) { - if (z->code_bits < 24) grow_buffer_unsafe(z); - // if it's NOT a restart, then just bail, so we get corrupt data - // rather than no data - if (!RESTART(z->marker)) return 1; - reset(z); - } - } - } - } - return 1; -} - -static int process_marker(jpeg *z, int m) -{ - int L; - switch (m) { - case MARKER_none: // no marker found - return e("expected marker","Corrupt JPEG"); - - case 0xC2: // SOF - progressive - return e("progressive jpeg","JPEG format not supported (progressive)"); - - case 0xDD: // DRI - specify restart interval - if (get16(z->s) != 4) return e("bad DRI len","Corrupt JPEG"); - z->restart_interval = get16(z->s); - return 1; - - case 0xDB: // DQT - define quantization table - L = get16(z->s)-2; - while (L > 0) { - int q = get8(z->s); - int p = q >> 4; - int t = q & 15,i; - if (p != 0) return e("bad DQT type","Corrupt JPEG"); - if (t > 3) return e("bad DQT table","Corrupt JPEG"); - for (i=0; i < 64; ++i) - z->dequant[t][dezigzag[i]] = get8u(z->s); - #ifdef STBI_SIMD - for (i=0; i < 64; ++i) - z->dequant2[t][i] = z->dequant[t][i]; - #endif - L -= 65; - } - return L==0; - - case 0xC4: // DHT - define huffman table - L = get16(z->s)-2; - while (L > 0) { - uint8 *v; - int sizes[16],i,m=0; - int q = get8(z->s); - int tc = q >> 4; - int th = q & 15; - if (tc > 1 || th > 3) return e("bad DHT header","Corrupt JPEG"); - for (i=0; i < 16; ++i) { - sizes[i] = get8(z->s); - m += sizes[i]; - } - L -= 17; - if (tc == 0) { - if (!build_huffman(z->huff_dc+th, sizes)) return 0; - v = z->huff_dc[th].values; - } else { - if (!build_huffman(z->huff_ac+th, sizes)) return 0; - v = z->huff_ac[th].values; - } - for (i=0; i < m; ++i) - v[i] = get8u(z->s); - L -= m; - } - return L==0; - } - // check for comment block or APP blocks - if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) { - skip(z->s, get16(z->s)-2); - return 1; - } - return 0; -} - -// after we see SOS -static int process_scan_header(jpeg *z) -{ - int i; - int Ls = get16(z->s); - z->scan_n = get8(z->s); - if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return e("bad SOS component count","Corrupt JPEG"); - if (Ls != 6+2*z->scan_n) return e("bad SOS len","Corrupt JPEG"); - for (i=0; i < z->scan_n; ++i) { - int id = get8(z->s), which; - int q = get8(z->s); - for (which = 0; which < z->s->img_n; ++which) - if (z->img_comp[which].id == id) - break; - if (which == z->s->img_n) return 0; - z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return e("bad DC huff","Corrupt JPEG"); - z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return e("bad AC huff","Corrupt JPEG"); - z->order[i] = which; - } - if (get8(z->s) != 0) return e("bad SOS","Corrupt JPEG"); - get8(z->s); // should be 63, but might be 0 - if (get8(z->s) != 0) return e("bad SOS","Corrupt JPEG"); - - return 1; -} - -static int process_frame_header(jpeg *z, int scan) -{ - stbi *s = z->s; - int Lf,p,i,q, h_max=1,v_max=1,c; - Lf = get16(s); if (Lf < 11) return e("bad SOF len","Corrupt JPEG"); // JPEG - p = get8(s); if (p != 8) return e("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline - s->img_y = get16(s); if (s->img_y == 0) return e("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG - s->img_x = get16(s); if (s->img_x == 0) return e("0 width","Corrupt JPEG"); // JPEG requires - c = get8(s); - if (c != 3 && c != 1) return e("bad component count","Corrupt JPEG"); // JFIF requires - s->img_n = c; - for (i=0; i < c; ++i) { - z->img_comp[i].data = NULL; - z->img_comp[i].linebuf = NULL; - } - - if (Lf != 8+3*s->img_n) return e("bad SOF len","Corrupt JPEG"); - - for (i=0; i < s->img_n; ++i) { - z->img_comp[i].id = get8(s); - if (z->img_comp[i].id != i+1) // JFIF requires - if (z->img_comp[i].id != i) // some version of jpegtran outputs non-JFIF-compliant files! - return e("bad component ID","Corrupt JPEG"); - q = get8(s); - z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return e("bad H","Corrupt JPEG"); - z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return e("bad V","Corrupt JPEG"); - z->img_comp[i].tq = get8(s); if (z->img_comp[i].tq > 3) return e("bad TQ","Corrupt JPEG"); - } - - if (scan != SCAN_load) return 1; - - if ((1 << 30) / s->img_x / s->img_n < s->img_y) return e("too large", "Image too large to decode"); - - for (i=0; i < s->img_n; ++i) { - if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h; - if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v; - } - - // compute interleaved mcu info - z->img_h_max = h_max; - z->img_v_max = v_max; - z->img_mcu_w = h_max * 8; - z->img_mcu_h = v_max * 8; - z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w; - z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h; - - for (i=0; i < s->img_n; ++i) { - // number of effective pixels (e.g. for non-interleaved MCU) - z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max; - z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max; - // to simplify generation, we'll allocate enough memory to decode - // the bogus oversized data from using interleaved MCUs and their - // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't - // discard the extra data until colorspace conversion - z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8; - z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8; - z->img_comp[i].raw_data = malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15); - if (z->img_comp[i].raw_data == NULL) { - for(--i; i >= 0; --i) { - free(z->img_comp[i].raw_data); - z->img_comp[i].data = NULL; - } - return e("outofmem", "Out of memory"); - } - // align blocks for installable-idct using mmx/sse - z->img_comp[i].data = (uint8*) (((size_t) z->img_comp[i].raw_data + 15) & ~15); - z->img_comp[i].linebuf = NULL; - } - - return 1; -} - -// use comparisons since in some cases we handle more than one case (e.g. SOF) -#define DNL(x) ((x) == 0xdc) -#define SOI(x) ((x) == 0xd8) -#define EOI(x) ((x) == 0xd9) -#define SOF(x) ((x) == 0xc0 || (x) == 0xc1) -#define SOS(x) ((x) == 0xda) - -static int decode_jpeg_header(jpeg *z, int scan) -{ - int m; - z->marker = MARKER_none; // initialize cached marker to empty - m = get_marker(z); - if (!SOI(m)) return e("no SOI","Corrupt JPEG"); - if (scan == SCAN_type) return 1; - m = get_marker(z); - while (!SOF(m)) { - if (!process_marker(z,m)) return 0; - m = get_marker(z); - while (m == MARKER_none) { - // some files have extra padding after their blocks, so ok, we'll scan - if (at_eof(z->s)) return e("no SOF", "Corrupt JPEG"); - m = get_marker(z); - } - } - if (!process_frame_header(z, scan)) return 0; - return 1; -} - -static int decode_jpeg_image(jpeg *j) -{ - int m; - j->restart_interval = 0; - if (!decode_jpeg_header(j, SCAN_load)) return 0; - m = get_marker(j); - while (!EOI(m)) { - if (SOS(m)) { - if (!process_scan_header(j)) return 0; - if (!parse_entropy_coded_data(j)) return 0; - if (j->marker == MARKER_none ) { - // handle 0s at the end of image data from IP Kamera 9060 - while (!at_eof(j->s)) { - int x = get8(j->s); - if (x == 255) { - j->marker = get8u(j->s); - break; - } else if (x != 0) { - return 0; - } - } - // if we reach eof without hitting a marker, get_marker() below will fail and we'll eventually return 0 - } - } else { - if (!process_marker(j, m)) return 0; - } - m = get_marker(j); - } - return 1; -} - -// static jfif-centered resampling (across block boundaries) - -typedef uint8 *(*resample_row_func)(uint8 *out, uint8 *in0, uint8 *in1, - int w, int hs); - -#define div4(x) ((uint8) ((x) >> 2)) - -static uint8 *resample_row_1(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int hs) -{ - STBI_NOTUSED(out); - STBI_NOTUSED(in_far); - STBI_NOTUSED(w); - STBI_NOTUSED(hs); - return in_near; -} - -static uint8* resample_row_v_2(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int hs) -{ - // need to generate two samples vertically for every one in input - int i; - STBI_NOTUSED(hs); - for (i=0; i < w; ++i) - out[i] = div4(3*in_near[i] + in_far[i] + 2); - return out; -} - -static uint8* resample_row_h_2(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int hs) -{ - // need to generate two samples horizontally for every one in input - int i; - uint8 *input = in_near; - - if (w == 1) { - // if only one sample, can't do any interpolation - out[0] = out[1] = input[0]; - return out; - } - - out[0] = input[0]; - out[1] = div4(input[0]*3 + input[1] + 2); - for (i=1; i < w-1; ++i) { - int n = 3*input[i]+2; - out[i*2+0] = div4(n+input[i-1]); - out[i*2+1] = div4(n+input[i+1]); - } - out[i*2+0] = div4(input[w-2]*3 + input[w-1] + 2); - out[i*2+1] = input[w-1]; - - STBI_NOTUSED(in_far); - STBI_NOTUSED(hs); - - return out; -} - -#define div16(x) ((uint8) ((x) >> 4)) - -static uint8 *resample_row_hv_2(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int hs) -{ - // need to generate 2x2 samples for every one in input - int i,t0,t1; - if (w == 1) { - out[0] = out[1] = div4(3*in_near[0] + in_far[0] + 2); - return out; - } - - t1 = 3*in_near[0] + in_far[0]; - out[0] = div4(t1+2); - for (i=1; i < w; ++i) { - t0 = t1; - t1 = 3*in_near[i]+in_far[i]; - out[i*2-1] = div16(3*t0 + t1 + 8); - out[i*2 ] = div16(3*t1 + t0 + 8); - } - out[w*2-1] = div4(t1+2); - - STBI_NOTUSED(hs); - - return out; -} - -static uint8 *resample_row_generic(uint8 *out, uint8 *in_near, uint8 * in_far, int w, int hs) -{ - // resample with nearest-neighbor - int i,j; - for (i=0; i < w; ++i) - for (j=0; j < hs; ++j) - out[i*hs+j] = in_near[i]; - return out; -} - -#define float2fixed(x) ((int) ((x) * 65536 + 0.5)) - -// 0.38 seconds on 3*anemones.jpg (0.25 with processor = Pro) -// VC6 without processor=Pro is generating multiple LEAs per multiply! -static void YCbCr_to_RGB_row(uint8 *out, const uint8 *y, const uint8 *pcb, const uint8 *pcr, int count, int step) -{ - int i; - for (i=0; i < count; ++i) { - int y_fixed = (y[i] << 16) + 32768; // rounding - int r,g,b; - int cr = pcr[i] - 128; - int cb = pcb[i] - 128; - r = y_fixed + cr*float2fixed(1.40200f); - g = y_fixed - cr*float2fixed(0.71414f) - cb*float2fixed(0.34414f); - b = y_fixed + cb*float2fixed(1.77200f); - r >>= 16; - g >>= 16; - b >>= 16; - if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } - if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } - if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } - out[0] = (uint8)r; - out[1] = (uint8)g; - out[2] = (uint8)b; - out[3] = 255; - out += step; - } -} - -#ifdef STBI_SIMD -static stbi_YCbCr_to_RGB_run stbi_YCbCr_installed = YCbCr_to_RGB_row; - -void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func) -{ - stbi_YCbCr_installed = func; -} -#endif - - -// clean up the temporary component buffers -static void cleanup_jpeg(jpeg *j) -{ - int i; - for (i=0; i < j->s->img_n; ++i) { - if (j->img_comp[i].data) { - free(j->img_comp[i].raw_data); - j->img_comp[i].data = NULL; - } - if (j->img_comp[i].linebuf) { - free(j->img_comp[i].linebuf); - j->img_comp[i].linebuf = NULL; - } - } -} - -typedef struct -{ - resample_row_func resample; - uint8 *line0,*line1; - int hs,vs; // expansion factor in each axis - int w_lores; // horizontal pixels pre-expansion - int ystep; // how far through vertical expansion we are - int ypos; // which pre-expansion row we're on -} stbi_resample; - -static uint8 *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int req_comp) -{ - int n, decode_n; - // validate req_comp - if (req_comp < 0 || req_comp > 4) return epuc("bad req_comp", "Internal error"); - z->s->img_n = 0; - - // load a jpeg image from whichever source - if (!decode_jpeg_image(z)) { cleanup_jpeg(z); return NULL; } - - // determine actual number of components to generate - n = req_comp ? req_comp : z->s->img_n; - - if (z->s->img_n == 3 && n < 3) - decode_n = 1; - else - decode_n = z->s->img_n; - - // resample and color-convert - { - int k; - uint i,j; - uint8 *output; - uint8 *coutput[4]; - - stbi_resample res_comp[4]; - - for (k=0; k < decode_n; ++k) { - stbi_resample *r = &res_comp[k]; - - // allocate line buffer big enough for upsampling off the edges - // with upsample factor of 4 - z->img_comp[k].linebuf = (uint8 *) malloc(z->s->img_x + 3); - if (!z->img_comp[k].linebuf) { cleanup_jpeg(z); return epuc("outofmem", "Out of memory"); } - - r->hs = z->img_h_max / z->img_comp[k].h; - r->vs = z->img_v_max / z->img_comp[k].v; - r->ystep = r->vs >> 1; - r->w_lores = (z->s->img_x + r->hs-1) / r->hs; - r->ypos = 0; - r->line0 = r->line1 = z->img_comp[k].data; - - if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1; - else if (r->hs == 1 && r->vs == 2) r->resample = resample_row_v_2; - else if (r->hs == 2 && r->vs == 1) r->resample = resample_row_h_2; - else if (r->hs == 2 && r->vs == 2) r->resample = resample_row_hv_2; - else r->resample = resample_row_generic; - } - - // can't error after this so, this is safe - output = (uint8 *) malloc(n * z->s->img_x * z->s->img_y + 1); - if (!output) { cleanup_jpeg(z); return epuc("outofmem", "Out of memory"); } - - // now go ahead and resample - for (j=0; j < z->s->img_y; ++j) { - uint8 *out = output + n * z->s->img_x * j; - for (k=0; k < decode_n; ++k) { - stbi_resample *r = &res_comp[k]; - int y_bot = r->ystep >= (r->vs >> 1); - coutput[k] = r->resample(z->img_comp[k].linebuf, - y_bot ? r->line1 : r->line0, - y_bot ? r->line0 : r->line1, - r->w_lores, r->hs); - if (++r->ystep >= r->vs) { - r->ystep = 0; - r->line0 = r->line1; - if (++r->ypos < z->img_comp[k].y) - r->line1 += z->img_comp[k].w2; - } - } - if (n >= 3) { - uint8 *y = coutput[0]; - if (z->s->img_n == 3) { - #ifdef STBI_SIMD - stbi_YCbCr_installed(out, y, coutput[1], coutput[2], z->s.img_x, n); - #else - YCbCr_to_RGB_row(out, y, coutput[1], coutput[2], z->s->img_x, n); - #endif - } else - for (i=0; i < z->s->img_x; ++i) { - out[0] = out[1] = out[2] = y[i]; - out[3] = 255; // not used if n==3 - out += n; - } - } else { - uint8 *y = coutput[0]; - if (n == 1) - for (i=0; i < z->s->img_x; ++i) out[i] = y[i]; - else - for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255; - } - } - cleanup_jpeg(z); - *out_x = z->s->img_x; - *out_y = z->s->img_y; - if (comp) *comp = z->s->img_n; // report original components, not output - return output; - } -} - -static unsigned char *stbi_jpeg_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - jpeg j; - j.s = s; - return load_jpeg_image(&j, x,y,comp,req_comp); -} - -static int stbi_jpeg_test(stbi *s) -{ - int r; - jpeg j; - j.s = s; - r = decode_jpeg_header(&j, SCAN_type); - stbi_rewind(s); - return r; -} - -static int stbi_jpeg_info_raw(jpeg *j, int *x, int *y, int *comp) -{ - if (!decode_jpeg_header(j, SCAN_header)) { - stbi_rewind( j->s ); - return 0; - } - if (x) *x = j->s->img_x; - if (y) *y = j->s->img_y; - if (comp) *comp = j->s->img_n; - return 1; -} - -static int stbi_jpeg_info(stbi *s, int *x, int *y, int *comp) -{ - jpeg j; - j.s = s; - return stbi_jpeg_info_raw(&j, x, y, comp); -} - -// public domain zlib decode v0.2 Sean Barrett 2006-11-18 -// simple implementation -// - all input must be provided in an upfront buffer -// - all output is written to a single output buffer (can malloc/realloc) -// performance -// - fast huffman - -// fast-way is faster to check than jpeg huffman, but slow way is slower -#define ZFAST_BITS 9 // accelerate all cases in default tables -#define ZFAST_MASK ((1 << ZFAST_BITS) - 1) - -// zlib-style huffman encoding -// (jpegs packs from left, zlib from right, so can't share code) -typedef struct -{ - uint16 fast[1 << ZFAST_BITS]; - uint16 firstcode[16]; - int maxcode[17]; - uint16 firstsymbol[16]; - uint8 size[288]; - uint16 value[288]; -} zhuffman; - -stbi_inline static int bitreverse16(int n) -{ - n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1); - n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2); - n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4); - n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8); - return n; -} - -stbi_inline static int bit_reverse(int v, int bits) -{ - assert(bits <= 16); - // to bit reverse n bits, reverse 16 and shift - // e.g. 11 bits, bit reverse and shift away 5 - return bitreverse16(v) >> (16-bits); -} - -static int zbuild_huffman(zhuffman *z, uint8 *sizelist, int num) -{ - int i,k=0; - int code, next_code[16], sizes[17]; - - // DEFLATE spec for generating codes - memset(sizes, 0, sizeof(sizes)); - memset(z->fast, 255, sizeof(z->fast)); - for (i=0; i < num; ++i) - ++sizes[sizelist[i]]; - sizes[0] = 0; - for (i=1; i < 16; ++i) - assert(sizes[i] <= (1 << i)); - code = 0; - for (i=1; i < 16; ++i) { - next_code[i] = code; - z->firstcode[i] = (uint16) code; - z->firstsymbol[i] = (uint16) k; - code = (code + sizes[i]); - if (sizes[i]) - if (code-1 >= (1 << i)) return e("bad codelengths","Corrupt JPEG"); - z->maxcode[i] = code << (16-i); // preshift for inner loop - code <<= 1; - k += sizes[i]; - } - z->maxcode[16] = 0x10000; // sentinel - for (i=0; i < num; ++i) { - int s = sizelist[i]; - if (s) { - int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s]; - z->size[c] = (uint8)s; - z->value[c] = (uint16)i; - if (s <= ZFAST_BITS) { - int k = bit_reverse(next_code[s],s); - while (k < (1 << ZFAST_BITS)) { - z->fast[k] = (uint16) c; - k += (1 << s); - } - } - ++next_code[s]; - } - } - return 1; -} - -// zlib-from-memory implementation for PNG reading -// because PNG allows splitting the zlib stream arbitrarily, -// and it's annoying structurally to have PNG call ZLIB call PNG, -// we require PNG read all the IDATs and combine them into a single -// memory buffer - -typedef struct -{ - uint8 *zbuffer, *zbuffer_end; - int num_bits; - uint32 code_buffer; - - char *zout; - char *zout_start; - char *zout_end; - int z_expandable; - - zhuffman z_length, z_distance; -} zbuf; - -stbi_inline static int zget8(zbuf *z) -{ - if (z->zbuffer >= z->zbuffer_end) return 0; - return *z->zbuffer++; -} - -static void fill_bits(zbuf *z) -{ - do { - assert(z->code_buffer < (1U << z->num_bits)); - z->code_buffer |= zget8(z) << z->num_bits; - z->num_bits += 8; - } while (z->num_bits <= 24); -} - -stbi_inline static unsigned int zreceive(zbuf *z, int n) -{ - unsigned int k; - if (z->num_bits < n) fill_bits(z); - k = z->code_buffer & ((1 << n) - 1); - z->code_buffer >>= n; - z->num_bits -= n; - return k; -} - -stbi_inline static int zhuffman_decode(zbuf *a, zhuffman *z) -{ - int b,s,k; - if (a->num_bits < 16) fill_bits(a); - b = z->fast[a->code_buffer & ZFAST_MASK]; - if (b < 0xffff) { - s = z->size[b]; - a->code_buffer >>= s; - a->num_bits -= s; - return z->value[b]; - } - - // not resolved by fast table, so compute it the slow way - // use jpeg approach, which requires MSbits at top - k = bit_reverse(a->code_buffer, 16); - for (s=ZFAST_BITS+1; ; ++s) - if (k < z->maxcode[s]) - break; - if (s == 16) return -1; // invalid code! - // code size is s, so: - b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s]; - assert(z->size[b] == s); - a->code_buffer >>= s; - a->num_bits -= s; - return z->value[b]; -} - -static int expand(zbuf *z, int n) // need to make room for n bytes -{ - char *q; - int cur, limit; - if (!z->z_expandable) return e("output buffer limit","Corrupt PNG"); - cur = (int) (z->zout - z->zout_start); - limit = (int) (z->zout_end - z->zout_start); - while (cur + n > limit) - limit *= 2; - q = (char *) realloc(z->zout_start, limit); - if (q == NULL) return e("outofmem", "Out of memory"); - z->zout_start = q; - z->zout = q + cur; - z->zout_end = q + limit; - return 1; -} - -static int length_base[31] = { - 3,4,5,6,7,8,9,10,11,13, - 15,17,19,23,27,31,35,43,51,59, - 67,83,99,115,131,163,195,227,258,0,0 }; - -static int length_extra[31]= -{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; - -static int dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, -257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; - -static int dist_extra[32] = -{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; - -static int parse_huffman_block(zbuf *a) -{ - for(;;) { - int z = zhuffman_decode(a, &a->z_length); - if (z < 256) { - if (z < 0) return e("bad huffman code","Corrupt PNG"); // error in huffman codes - if (a->zout >= a->zout_end) if (!expand(a, 1)) return 0; - *a->zout++ = (char) z; - } else { - uint8 *p; - int len,dist; - if (z == 256) return 1; - z -= 257; - len = length_base[z]; - if (length_extra[z]) len += zreceive(a, length_extra[z]); - z = zhuffman_decode(a, &a->z_distance); - if (z < 0) return e("bad huffman code","Corrupt PNG"); - dist = dist_base[z]; - if (dist_extra[z]) dist += zreceive(a, dist_extra[z]); - if (a->zout - a->zout_start < dist) return e("bad dist","Corrupt PNG"); - if (a->zout + len > a->zout_end) if (!expand(a, len)) return 0; - p = (uint8 *) (a->zout - dist); - while (len--) - *a->zout++ = *p++; - } - } -} - -static int compute_huffman_codes(zbuf *a) -{ - static uint8 length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; - zhuffman z_codelength; - uint8 lencodes[286+32+137];//padding for maximum single op - uint8 codelength_sizes[19]; - int i,n; - - int hlit = zreceive(a,5) + 257; - int hdist = zreceive(a,5) + 1; - int hclen = zreceive(a,4) + 4; - - memset(codelength_sizes, 0, sizeof(codelength_sizes)); - for (i=0; i < hclen; ++i) { - int s = zreceive(a,3); - codelength_sizes[length_dezigzag[i]] = (uint8) s; - } - if (!zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0; - - n = 0; - while (n < hlit + hdist) { - int c = zhuffman_decode(a, &z_codelength); - assert(c >= 0 && c < 19); - if (c < 16) - lencodes[n++] = (uint8) c; - else if (c == 16) { - c = zreceive(a,2)+3; - memset(lencodes+n, lencodes[n-1], c); - n += c; - } else if (c == 17) { - c = zreceive(a,3)+3; - memset(lencodes+n, 0, c); - n += c; - } else { - assert(c == 18); - c = zreceive(a,7)+11; - memset(lencodes+n, 0, c); - n += c; - } - } - if (n != hlit+hdist) return e("bad codelengths","Corrupt PNG"); - if (!zbuild_huffman(&a->z_length, lencodes, hlit)) return 0; - if (!zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0; - return 1; -} - -static int parse_uncompressed_block(zbuf *a) -{ - uint8 header[4]; - int len,nlen,k; - if (a->num_bits & 7) - zreceive(a, a->num_bits & 7); // discard - // drain the bit-packed data into header - k = 0; - while (a->num_bits > 0) { - header[k++] = (uint8) (a->code_buffer & 255); // wtf this warns? - a->code_buffer >>= 8; - a->num_bits -= 8; - } - assert(a->num_bits == 0); - // now fill header the normal way - while (k < 4) - header[k++] = (uint8) zget8(a); - len = header[1] * 256 + header[0]; - nlen = header[3] * 256 + header[2]; - if (nlen != (len ^ 0xffff)) return e("zlib corrupt","Corrupt PNG"); - if (a->zbuffer + len > a->zbuffer_end) return e("read past buffer","Corrupt PNG"); - if (a->zout + len > a->zout_end) - if (!expand(a, len)) return 0; - memcpy(a->zout, a->zbuffer, len); - a->zbuffer += len; - a->zout += len; - return 1; -} - -static int parse_zlib_header(zbuf *a) -{ - int cmf = zget8(a); - int cm = cmf & 15; - /* int cinfo = cmf >> 4; */ - int flg = zget8(a); - if ((cmf*256+flg) % 31 != 0) return e("bad zlib header","Corrupt PNG"); // zlib spec - if (flg & 32) return e("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png - if (cm != 8) return e("bad compression","Corrupt PNG"); // DEFLATE required for png - // window = 1 << (8 + cinfo)... but who cares, we fully buffer output - return 1; -} - -// @TODO: should statically initialize these for optimal thread safety -static uint8 default_length[288], default_distance[32]; -static void init_defaults(void) -{ - int i; // use <= to match clearly with spec - for (i=0; i <= 143; ++i) default_length[i] = 8; - for ( ; i <= 255; ++i) default_length[i] = 9; - for ( ; i <= 279; ++i) default_length[i] = 7; - for ( ; i <= 287; ++i) default_length[i] = 8; - - for (i=0; i <= 31; ++i) default_distance[i] = 5; -} - -int stbi_png_partial; // a quick hack to only allow decoding some of a PNG... I should implement real streaming support instead -static int parse_zlib(zbuf *a, int parse_header) -{ - int final, type; - if (parse_header) - if (!parse_zlib_header(a)) return 0; - a->num_bits = 0; - a->code_buffer = 0; - do { - final = zreceive(a,1); - type = zreceive(a,2); - if (type == 0) { - if (!parse_uncompressed_block(a)) return 0; - } else if (type == 3) { - return 0; - } else { - if (type == 1) { - // use fixed code lengths - if (!default_distance[31]) init_defaults(); - if (!zbuild_huffman(&a->z_length , default_length , 288)) return 0; - if (!zbuild_huffman(&a->z_distance, default_distance, 32)) return 0; - } else { - if (!compute_huffman_codes(a)) return 0; - } - if (!parse_huffman_block(a)) return 0; - } - if (stbi_png_partial && a->zout - a->zout_start > 65536) - break; - } while (!final); - return 1; -} - -static int do_zlib(zbuf *a, char *obuf, int olen, int exp, int parse_header) -{ - a->zout_start = obuf; - a->zout = obuf; - a->zout_end = obuf + olen; - a->z_expandable = exp; - - return parse_zlib(a, parse_header); -} - -char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen) -{ - zbuf a; - char *p = (char *) malloc(initial_size); - if (p == NULL) return NULL; - a.zbuffer = (uint8 *) buffer; - a.zbuffer_end = (uint8 *) buffer + len; - if (do_zlib(&a, p, initial_size, 1, 1)) { - if (outlen) *outlen = (int) (a.zout - a.zout_start); - return a.zout_start; - } else { - free(a.zout_start); - return NULL; - } -} - -char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen) -{ - return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen); -} - -char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header) -{ - zbuf a; - char *p = (char *) malloc(initial_size); - if (p == NULL) return NULL; - a.zbuffer = (uint8 *) buffer; - a.zbuffer_end = (uint8 *) buffer + len; - if (do_zlib(&a, p, initial_size, 1, parse_header)) { - if (outlen) *outlen = (int) (a.zout - a.zout_start); - return a.zout_start; - } else { - free(a.zout_start); - return NULL; - } -} - -int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen) -{ - zbuf a; - a.zbuffer = (uint8 *) ibuffer; - a.zbuffer_end = (uint8 *) ibuffer + ilen; - if (do_zlib(&a, obuffer, olen, 0, 1)) - return (int) (a.zout - a.zout_start); - else - return -1; -} - -char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen) -{ - zbuf a; - char *p = (char *) malloc(16384); - if (p == NULL) return NULL; - a.zbuffer = (uint8 *) buffer; - a.zbuffer_end = (uint8 *) buffer+len; - if (do_zlib(&a, p, 16384, 1, 0)) { - if (outlen) *outlen = (int) (a.zout - a.zout_start); - return a.zout_start; - } else { - free(a.zout_start); - return NULL; - } -} - -int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen) -{ - zbuf a; - a.zbuffer = (uint8 *) ibuffer; - a.zbuffer_end = (uint8 *) ibuffer + ilen; - if (do_zlib(&a, obuffer, olen, 0, 0)) - return (int) (a.zout - a.zout_start); - else - return -1; -} - -// public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18 -// simple implementation -// - only 8-bit samples -// - no CRC checking -// - allocates lots of intermediate memory -// - avoids problem of streaming data between subsystems -// - avoids explicit window management -// performance -// - uses stb_zlib, a PD zlib implementation with fast huffman decoding - - -typedef struct -{ - uint32 length; - uint32 type; -} chunk; - -#define PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) - -static chunk get_chunk_header(stbi *s) -{ - chunk c; - c.length = get32(s); - c.type = get32(s); - return c; -} - -static int check_png_header(stbi *s) -{ - static uint8 png_sig[8] = { 137,80,78,71,13,10,26,10 }; - int i; - for (i=0; i < 8; ++i) - if (get8u(s) != png_sig[i]) return e("bad png sig","Not a PNG"); - return 1; -} - -typedef struct -{ - stbi *s; - uint8 *idata, *expanded, *out; -} png; - - -enum { - F_none=0, F_sub=1, F_up=2, F_avg=3, F_paeth=4, - F_avg_first, F_paeth_first -}; - -static uint8 first_row_filter[5] = -{ - F_none, F_sub, F_none, F_avg_first, F_paeth_first -}; - -static int paeth(int a, int b, int c) -{ - int p = a + b - c; - int pa = abs(p-a); - int pb = abs(p-b); - int pc = abs(p-c); - if (pa <= pb && pa <= pc) return a; - if (pb <= pc) return b; - return c; -} - -// create the png data from post-deflated data -static int create_png_image_raw(png *a, uint8 *raw, uint32 raw_len, int out_n, uint32 x, uint32 y) -{ - stbi *s = a->s; - uint32 i,j,stride = x*out_n; - int k; - int img_n = s->img_n; // copy it into a local for later - assert(out_n == s->img_n || out_n == s->img_n+1); - if (stbi_png_partial) y = 1; - a->out = (uint8 *) malloc(x * y * out_n); - if (!a->out) return e("outofmem", "Out of memory"); - if (!stbi_png_partial) { - if (s->img_x == x && s->img_y == y) { - if (raw_len != (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG"); - } else { // interlaced: - if (raw_len < (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG"); - } - } - for (j=0; j < y; ++j) { - uint8 *cur = a->out + stride*j; - uint8 *prior = cur - stride; - int filter = *raw++; - if (filter > 4) return e("invalid filter","Corrupt PNG"); - // if first row, use special filter that doesn't sample previous row - if (j == 0) filter = first_row_filter[filter]; - // handle first pixel explicitly - for (k=0; k < img_n; ++k) { - switch (filter) { - case F_none : cur[k] = raw[k]; break; - case F_sub : cur[k] = raw[k]; break; - case F_up : cur[k] = raw[k] + prior[k]; break; - case F_avg : cur[k] = raw[k] + (prior[k]>>1); break; - case F_paeth : cur[k] = (uint8) (raw[k] + paeth(0,prior[k],0)); break; - case F_avg_first : cur[k] = raw[k]; break; - case F_paeth_first: cur[k] = raw[k]; break; - } - } - if (img_n != out_n) cur[img_n] = 255; - raw += img_n; - cur += out_n; - prior += out_n; - // this is a little gross, so that we don't switch per-pixel or per-component - if (img_n == out_n) { - #define CASE(f) \ - case f: \ - for (i=x-1; i >= 1; --i, raw+=img_n,cur+=img_n,prior+=img_n) \ - for (k=0; k < img_n; ++k) - switch (filter) { - CASE(F_none) cur[k] = raw[k]; break; - CASE(F_sub) cur[k] = raw[k] + cur[k-img_n]; break; - CASE(F_up) cur[k] = raw[k] + prior[k]; break; - CASE(F_avg) cur[k] = raw[k] + ((prior[k] + cur[k-img_n])>>1); break; - CASE(F_paeth) cur[k] = (uint8) (raw[k] + paeth(cur[k-img_n],prior[k],prior[k-img_n])); break; - CASE(F_avg_first) cur[k] = raw[k] + (cur[k-img_n] >> 1); break; - CASE(F_paeth_first) cur[k] = (uint8) (raw[k] + paeth(cur[k-img_n],0,0)); break; - } - #undef CASE - } else { - assert(img_n+1 == out_n); - #define CASE(f) \ - case f: \ - for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \ - for (k=0; k < img_n; ++k) - switch (filter) { - CASE(F_none) cur[k] = raw[k]; break; - CASE(F_sub) cur[k] = raw[k] + cur[k-out_n]; break; - CASE(F_up) cur[k] = raw[k] + prior[k]; break; - CASE(F_avg) cur[k] = raw[k] + ((prior[k] + cur[k-out_n])>>1); break; - CASE(F_paeth) cur[k] = (uint8) (raw[k] + paeth(cur[k-out_n],prior[k],prior[k-out_n])); break; - CASE(F_avg_first) cur[k] = raw[k] + (cur[k-out_n] >> 1); break; - CASE(F_paeth_first) cur[k] = (uint8) (raw[k] + paeth(cur[k-out_n],0,0)); break; - } - #undef CASE - } - } - return 1; -} - -static int create_png_image(png *a, uint8 *raw, uint32 raw_len, int out_n, int interlaced) -{ - uint8 *final; - int p; - int save; - if (!interlaced) - return create_png_image_raw(a, raw, raw_len, out_n, a->s->img_x, a->s->img_y); - save = stbi_png_partial; - stbi_png_partial = 0; - - // de-interlacing - final = (uint8 *) malloc(a->s->img_x * a->s->img_y * out_n); - for (p=0; p < 7; ++p) { - int xorig[] = { 0,4,0,2,0,1,0 }; - int yorig[] = { 0,0,4,0,2,0,1 }; - int xspc[] = { 8,8,4,4,2,2,1 }; - int yspc[] = { 8,8,8,4,4,2,2 }; - int i,j,x,y; - // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1 - x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p]; - y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p]; - if (x && y) { - if (!create_png_image_raw(a, raw, raw_len, out_n, x, y)) { - free(final); - return 0; - } - for (j=0; j < y; ++j) - for (i=0; i < x; ++i) - memcpy(final + (j*yspc[p]+yorig[p])*a->s->img_x*out_n + (i*xspc[p]+xorig[p])*out_n, - a->out + (j*x+i)*out_n, out_n); - free(a->out); - raw += (x*out_n+1)*y; - raw_len -= (x*out_n+1)*y; - } - } - a->out = final; - - stbi_png_partial = save; - return 1; -} - -static int compute_transparency(png *z, uint8 tc[3], int out_n) -{ - stbi *s = z->s; - uint32 i, pixel_count = s->img_x * s->img_y; - uint8 *p = z->out; - - // compute color-based transparency, assuming we've - // already got 255 as the alpha value in the output - assert(out_n == 2 || out_n == 4); - - if (out_n == 2) { - for (i=0; i < pixel_count; ++i) { - p[1] = (p[0] == tc[0] ? 0 : 255); - p += 2; - } - } else { - for (i=0; i < pixel_count; ++i) { - if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) - p[3] = 0; - p += 4; - } - } - return 1; -} - -static int expand_palette(png *a, uint8 *palette, int len, int pal_img_n) -{ - uint32 i, pixel_count = a->s->img_x * a->s->img_y; - uint8 *p, *temp_out, *orig = a->out; - - p = (uint8 *) malloc(pixel_count * pal_img_n); - if (p == NULL) return e("outofmem", "Out of memory"); - - // between here and free(out) below, exitting would leak - temp_out = p; - - if (pal_img_n == 3) { - for (i=0; i < pixel_count; ++i) { - int n = orig[i]*4; - p[0] = palette[n ]; - p[1] = palette[n+1]; - p[2] = palette[n+2]; - p += 3; - } - } else { - for (i=0; i < pixel_count; ++i) { - int n = orig[i]*4; - p[0] = palette[n ]; - p[1] = palette[n+1]; - p[2] = palette[n+2]; - p[3] = palette[n+3]; - p += 4; - } - } - free(a->out); - a->out = temp_out; - - STBI_NOTUSED(len); - - return 1; -} - -static int stbi_unpremultiply_on_load = 0; -static int stbi_de_iphone_flag = 0; - -void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply) -{ - stbi_unpremultiply_on_load = flag_true_if_should_unpremultiply; -} -void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert) -{ - stbi_de_iphone_flag = flag_true_if_should_convert; -} - -static void stbi_de_iphone(png *z) -{ - stbi *s = z->s; - uint32 i, pixel_count = s->img_x * s->img_y; - uint8 *p = z->out; - - if (s->img_out_n == 3) { // convert bgr to rgb - for (i=0; i < pixel_count; ++i) { - uint8 t = p[0]; - p[0] = p[2]; - p[2] = t; - p += 3; - } - } else { - assert(s->img_out_n == 4); - if (stbi_unpremultiply_on_load) { - // convert bgr to rgb and unpremultiply - for (i=0; i < pixel_count; ++i) { - uint8 a = p[3]; - uint8 t = p[0]; - if (a) { - p[0] = p[2] * 255 / a; - p[1] = p[1] * 255 / a; - p[2] = t * 255 / a; - } else { - p[0] = p[2]; - p[2] = t; - } - p += 4; - } - } else { - // convert bgr to rgb - for (i=0; i < pixel_count; ++i) { - uint8 t = p[0]; - p[0] = p[2]; - p[2] = t; - p += 4; - } - } - } -} - -static int parse_png_file(png *z, int scan, int req_comp) -{ - uint8 palette[1024], pal_img_n=0; - uint8 has_trans=0, tc[3]; - uint32 ioff=0, idata_limit=0, i, pal_len=0; - int first=1,k,interlace=0, iphone=0; - stbi *s = z->s; - - z->expanded = NULL; - z->idata = NULL; - z->out = NULL; - - if (!check_png_header(s)) return 0; - - if (scan == SCAN_type) return 1; - - for (;;) { - chunk c = get_chunk_header(s); - switch (c.type) { - case PNG_TYPE('C','g','B','I'): - iphone = stbi_de_iphone_flag; - skip(s, c.length); - break; - case PNG_TYPE('I','H','D','R'): { - int depth,color,comp,filter; - if (!first) return e("multiple IHDR","Corrupt PNG"); - first = 0; - if (c.length != 13) return e("bad IHDR len","Corrupt PNG"); - s->img_x = get32(s); if (s->img_x > (1 << 24)) return e("too large","Very large image (corrupt?)"); - s->img_y = get32(s); if (s->img_y > (1 << 24)) return e("too large","Very large image (corrupt?)"); - depth = get8(s); if (depth != 8) return e("8bit only","PNG not supported: 8-bit only"); - color = get8(s); if (color > 6) return e("bad ctype","Corrupt PNG"); - if (color == 3) pal_img_n = 3; else if (color & 1) return e("bad ctype","Corrupt PNG"); - comp = get8(s); if (comp) return e("bad comp method","Corrupt PNG"); - filter= get8(s); if (filter) return e("bad filter method","Corrupt PNG"); - interlace = get8(s); if (interlace>1) return e("bad interlace method","Corrupt PNG"); - if (!s->img_x || !s->img_y) return e("0-pixel image","Corrupt PNG"); - if (!pal_img_n) { - s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0); - if ((1 << 30) / s->img_x / s->img_n < s->img_y) return e("too large", "Image too large to decode"); - if (scan == SCAN_header) return 1; - } else { - // if paletted, then pal_n is our final components, and - // img_n is # components to decompress/filter. - s->img_n = 1; - if ((1 << 30) / s->img_x / 4 < s->img_y) return e("too large","Corrupt PNG"); - // if SCAN_header, have to scan to see if we have a tRNS - } - break; - } - - case PNG_TYPE('P','L','T','E'): { - if (first) return e("first not IHDR", "Corrupt PNG"); - if (c.length > 256*3) return e("invalid PLTE","Corrupt PNG"); - pal_len = c.length / 3; - if (pal_len * 3 != c.length) return e("invalid PLTE","Corrupt PNG"); - for (i=0; i < pal_len; ++i) { - palette[i*4+0] = get8u(s); - palette[i*4+1] = get8u(s); - palette[i*4+2] = get8u(s); - palette[i*4+3] = 255; - } - break; - } - - case PNG_TYPE('t','R','N','S'): { - if (first) return e("first not IHDR", "Corrupt PNG"); - if (z->idata) return e("tRNS after IDAT","Corrupt PNG"); - if (pal_img_n) { - if (scan == SCAN_header) { s->img_n = 4; return 1; } - if (pal_len == 0) return e("tRNS before PLTE","Corrupt PNG"); - if (c.length > pal_len) return e("bad tRNS len","Corrupt PNG"); - pal_img_n = 4; - for (i=0; i < c.length; ++i) - palette[i*4+3] = get8u(s); - } else { - if (!(s->img_n & 1)) return e("tRNS with alpha","Corrupt PNG"); - if (c.length != (uint32) s->img_n*2) return e("bad tRNS len","Corrupt PNG"); - has_trans = 1; - for (k=0; k < s->img_n; ++k) - tc[k] = (uint8) get16(s); // non 8-bit images will be larger - } - break; - } - - case PNG_TYPE('I','D','A','T'): { - if (first) return e("first not IHDR", "Corrupt PNG"); - if (pal_img_n && !pal_len) return e("no PLTE","Corrupt PNG"); - if (scan == SCAN_header) { s->img_n = pal_img_n; return 1; } - if (ioff + c.length > idata_limit) { - uint8 *p; - if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096; - while (ioff + c.length > idata_limit) - idata_limit *= 2; - p = (uint8 *) realloc(z->idata, idata_limit); if (p == NULL) return e("outofmem", "Out of memory"); - z->idata = p; - } - if (!getn(s, z->idata+ioff,c.length)) return e("outofdata","Corrupt PNG"); - ioff += c.length; - break; - } - - case PNG_TYPE('I','E','N','D'): { - uint32 raw_len; - if (first) return e("first not IHDR", "Corrupt PNG"); - if (scan != SCAN_load) return 1; - if (z->idata == NULL) return e("no IDAT","Corrupt PNG"); - z->expanded = (uint8 *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, 16384, (int *) &raw_len, !iphone); - if (z->expanded == NULL) return 0; // zlib should set error - free(z->idata); z->idata = NULL; - if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans) - s->img_out_n = s->img_n+1; - else - s->img_out_n = s->img_n; - if (!create_png_image(z, z->expanded, raw_len, s->img_out_n, interlace)) return 0; - if (has_trans) - if (!compute_transparency(z, tc, s->img_out_n)) return 0; - if (iphone && s->img_out_n > 2) - stbi_de_iphone(z); - if (pal_img_n) { - // pal_img_n == 3 or 4 - s->img_n = pal_img_n; // record the actual colors we had - s->img_out_n = pal_img_n; - if (req_comp >= 3) s->img_out_n = req_comp; - if (!expand_palette(z, palette, pal_len, s->img_out_n)) - return 0; - } - free(z->expanded); z->expanded = NULL; - return 1; - } - - default: - // if critical, fail - if (first) return e("first not IHDR", "Corrupt PNG"); - if ((c.type & (1 << 29)) == 0) { - #ifndef STBI_NO_FAILURE_STRINGS - // not threadsafe - static char invalid_chunk[] = "XXXX chunk not known"; - invalid_chunk[0] = (uint8) (c.type >> 24); - invalid_chunk[1] = (uint8) (c.type >> 16); - invalid_chunk[2] = (uint8) (c.type >> 8); - invalid_chunk[3] = (uint8) (c.type >> 0); - #endif - return e(invalid_chunk, "PNG not supported: unknown chunk type"); - } - skip(s, c.length); - break; - } - // end of chunk, read and skip CRC - get32(s); - } -} - -static unsigned char *do_png(png *p, int *x, int *y, int *n, int req_comp) -{ - unsigned char *result=NULL; - if (req_comp < 0 || req_comp > 4) return epuc("bad req_comp", "Internal error"); - if (parse_png_file(p, SCAN_load, req_comp)) { - result = p->out; - p->out = NULL; - if (req_comp && req_comp != p->s->img_out_n) { - result = convert_format(result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); - p->s->img_out_n = req_comp; - if (result == NULL) return result; - } - *x = p->s->img_x; - *y = p->s->img_y; - if (n) *n = p->s->img_n; - } - free(p->out); p->out = NULL; - free(p->expanded); p->expanded = NULL; - free(p->idata); p->idata = NULL; - - return result; -} - -static unsigned char *stbi_png_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - png p; - p.s = s; - return do_png(&p, x,y,comp,req_comp); -} - -static int stbi_png_test(stbi *s) -{ - int r; - r = check_png_header(s); - stbi_rewind(s); - return r; -} - -static int stbi_png_info_raw(png *p, int *x, int *y, int *comp) -{ - if (!parse_png_file(p, SCAN_header, 0)) { - stbi_rewind( p->s ); - return 0; - } - if (x) *x = p->s->img_x; - if (y) *y = p->s->img_y; - if (comp) *comp = p->s->img_n; - return 1; -} - -static int stbi_png_info(stbi *s, int *x, int *y, int *comp) -{ - png p; - p.s = s; - return stbi_png_info_raw(&p, x, y, comp); -} - -// Microsoft/Windows BMP image - -static int bmp_test(stbi *s) -{ - int sz; - if (get8(s) != 'B') return 0; - if (get8(s) != 'M') return 0; - get32le(s); // discard filesize - get16le(s); // discard reserved - get16le(s); // discard reserved - get32le(s); // discard data offset - sz = get32le(s); - if (sz == 12 || sz == 40 || sz == 56 || sz == 108) return 1; - return 0; -} - -static int stbi_bmp_test(stbi *s) -{ - int r = bmp_test(s); - stbi_rewind(s); - return r; -} - - -// returns 0..31 for the highest set bit -static int high_bit(unsigned int z) -{ - int n=0; - if (z == 0) return -1; - if (z >= 0x10000) n += 16, z >>= 16; - if (z >= 0x00100) n += 8, z >>= 8; - if (z >= 0x00010) n += 4, z >>= 4; - if (z >= 0x00004) n += 2, z >>= 2; - if (z >= 0x00002) n += 1, z >>= 1; - return n; -} - -static int bitcount(unsigned int a) -{ - a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2 - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4 - a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits - a = (a + (a >> 8)); // max 16 per 8 bits - a = (a + (a >> 16)); // max 32 per 8 bits - return a & 0xff; -} - -static int shiftsigned(int v, int shift, int bits) -{ - int result; - int z=0; - - if (shift < 0) v <<= -shift; - else v >>= shift; - result = v; - - z = bits; - while (z < 8) { - result += v >> z; - z += bits; - } - return result; -} - -static stbi_uc *bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - uint8 *out; - unsigned int mr=0,mg=0,mb=0,ma=0, fake_a=0; - stbi_uc pal[256][4]; - int psize=0,i,j,compress=0,width; - int bpp, flip_vertically, pad, target, offset, hsz; - if (get8(s) != 'B' || get8(s) != 'M') return epuc("not BMP", "Corrupt BMP"); - get32le(s); // discard filesize - get16le(s); // discard reserved - get16le(s); // discard reserved - offset = get32le(s); - hsz = get32le(s); - if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108) return epuc("unknown BMP", "BMP type not supported: unknown"); - if (hsz == 12) { - s->img_x = get16le(s); - s->img_y = get16le(s); - } else { - s->img_x = get32le(s); - s->img_y = get32le(s); - } - if (get16le(s) != 1) return epuc("bad BMP", "bad BMP"); - bpp = get16le(s); - if (bpp == 1) return epuc("monochrome", "BMP type not supported: 1-bit"); - flip_vertically = ((int) s->img_y) > 0; - s->img_y = abs((int) s->img_y); - if (hsz == 12) { - if (bpp < 24) - psize = (offset - 14 - 24) / 3; - } else { - compress = get32le(s); - if (compress == 1 || compress == 2) return epuc("BMP RLE", "BMP type not supported: RLE"); - get32le(s); // discard sizeof - get32le(s); // discard hres - get32le(s); // discard vres - get32le(s); // discard colorsused - get32le(s); // discard max important - if (hsz == 40 || hsz == 56) { - if (hsz == 56) { - get32le(s); - get32le(s); - get32le(s); - get32le(s); - } - if (bpp == 16 || bpp == 32) { - mr = mg = mb = 0; - if (compress == 0) { - if (bpp == 32) { - mr = 0xffu << 16; - mg = 0xffu << 8; - mb = 0xffu << 0; - ma = 0xffu << 24; - fake_a = 1; // @TODO: check for cases like alpha value is all 0 and switch it to 255 - } else { - mr = 31u << 10; - mg = 31u << 5; - mb = 31u << 0; - } - } else if (compress == 3) { - mr = get32le(s); - mg = get32le(s); - mb = get32le(s); - // not documented, but generated by photoshop and handled by mspaint - if (mr == mg && mg == mb) { - // ?!?!? - return epuc("bad BMP", "bad BMP"); - } - } else - return epuc("bad BMP", "bad BMP"); - } - } else { - assert(hsz == 108); - mr = get32le(s); - mg = get32le(s); - mb = get32le(s); - ma = get32le(s); - get32le(s); // discard color space - for (i=0; i < 12; ++i) - get32le(s); // discard color space parameters - } - if (bpp < 16) - psize = (offset - 14 - hsz) >> 2; - } - s->img_n = ma ? 4 : 3; - if (req_comp && req_comp >= 3) // we can directly decode 3 or 4 - target = req_comp; - else - target = s->img_n; // if they want monochrome, we'll post-convert - out = (stbi_uc *) malloc(target * s->img_x * s->img_y); - if (!out) return epuc("outofmem", "Out of memory"); - if (bpp < 16) { - int z=0; - if (psize == 0 || psize > 256) { free(out); return epuc("invalid", "Corrupt BMP"); } - for (i=0; i < psize; ++i) { - pal[i][2] = get8u(s); - pal[i][1] = get8u(s); - pal[i][0] = get8u(s); - if (hsz != 12) get8(s); - pal[i][3] = 255; - } - skip(s, offset - 14 - hsz - psize * (hsz == 12 ? 3 : 4)); - if (bpp == 4) width = (s->img_x + 1) >> 1; - else if (bpp == 8) width = s->img_x; - else { free(out); return epuc("bad bpp", "Corrupt BMP"); } - pad = (-width)&3; - for (j=0; j < (int) s->img_y; ++j) { - for (i=0; i < (int) s->img_x; i += 2) { - int v=get8(s),v2=0; - if (bpp == 4) { - v2 = v & 15; - v >>= 4; - } - out[z++] = pal[v][0]; - out[z++] = pal[v][1]; - out[z++] = pal[v][2]; - if (target == 4) out[z++] = 255; - if (i+1 == (int) s->img_x) break; - v = (bpp == 8) ? get8(s) : v2; - out[z++] = pal[v][0]; - out[z++] = pal[v][1]; - out[z++] = pal[v][2]; - if (target == 4) out[z++] = 255; - } - skip(s, pad); - } - } else { - int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0; - int z = 0; - int easy=0; - skip(s, offset - 14 - hsz); - if (bpp == 24) width = 3 * s->img_x; - else if (bpp == 16) width = 2*s->img_x; - else /* bpp = 32 and pad = 0 */ width=0; - pad = (-width) & 3; - if (bpp == 24) { - easy = 1; - } else if (bpp == 32) { - if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000) - easy = 2; - } - if (!easy) { - if (!mr || !mg || !mb) { free(out); return epuc("bad masks", "Corrupt BMP"); } - // right shift amt to put high bit in position #7 - rshift = high_bit(mr)-7; rcount = bitcount(mr); - gshift = high_bit(mg)-7; gcount = bitcount(mr); - bshift = high_bit(mb)-7; bcount = bitcount(mr); - ashift = high_bit(ma)-7; acount = bitcount(mr); - } - for (j=0; j < (int) s->img_y; ++j) { - if (easy) { - for (i=0; i < (int) s->img_x; ++i) { - int a; - out[z+2] = get8u(s); - out[z+1] = get8u(s); - out[z+0] = get8u(s); - z += 3; - a = (easy == 2 ? get8(s) : 255); - if (target == 4) out[z++] = (uint8) a; - } - } else { - for (i=0; i < (int) s->img_x; ++i) { - uint32 v = (bpp == 16 ? get16le(s) : get32le(s)); - int a; - out[z++] = (uint8) shiftsigned(v & mr, rshift, rcount); - out[z++] = (uint8) shiftsigned(v & mg, gshift, gcount); - out[z++] = (uint8) shiftsigned(v & mb, bshift, bcount); - a = (ma ? shiftsigned(v & ma, ashift, acount) : 255); - if (target == 4) out[z++] = (uint8) a; - } - } - skip(s, pad); - } - } - if (flip_vertically) { - stbi_uc t; - for (j=0; j < (int) s->img_y>>1; ++j) { - stbi_uc *p1 = out + j *s->img_x*target; - stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target; - for (i=0; i < (int) s->img_x*target; ++i) { - t = p1[i], p1[i] = p2[i], p2[i] = t; - } - } - } - - if (req_comp && req_comp != target) { - out = convert_format(out, target, req_comp, s->img_x, s->img_y); - if (out == NULL) return out; // convert_format frees input on failure - } - - *x = s->img_x; - *y = s->img_y; - if (comp) *comp = s->img_n; - return out; -} - -static stbi_uc *stbi_bmp_load(stbi *s,int *x, int *y, int *comp, int req_comp) -{ - return bmp_load(s, x,y,comp,req_comp); -} - - -// Targa Truevision - TGA -// by Jonathan Dummer - -static int tga_info(stbi *s, int *x, int *y, int *comp) -{ - int tga_w, tga_h, tga_comp; - int sz; - get8u(s); // discard Offset - sz = get8u(s); // color type - if( sz > 1 ) { - stbi_rewind(s); - return 0; // only RGB or indexed allowed - } - sz = get8u(s); // image type - // only RGB or grey allowed, +/- RLE - if ((sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11)) return 0; - skip(s,9); - tga_w = get16le(s); - if( tga_w < 1 ) { - stbi_rewind(s); - return 0; // test width - } - tga_h = get16le(s); - if( tga_h < 1 ) { - stbi_rewind(s); - return 0; // test height - } - sz = get8(s); // bits per pixel - // only RGB or RGBA or grey allowed - if ((sz != 8) && (sz != 16) && (sz != 24) && (sz != 32)) { - stbi_rewind(s); - return 0; - } - tga_comp = sz; - if (x) *x = tga_w; - if (y) *y = tga_h; - if (comp) *comp = tga_comp / 8; - return 1; // seems to have passed everything -} - -int stbi_tga_info(stbi *s, int *x, int *y, int *comp) -{ - return tga_info(s, x, y, comp); -} - -static int tga_test(stbi *s) -{ - int sz; - get8u(s); // discard Offset - sz = get8u(s); // color type - if ( sz > 1 ) return 0; // only RGB or indexed allowed - sz = get8u(s); // image type - if ( (sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11) ) return 0; // only RGB or grey allowed, +/- RLE - get16(s); // discard palette start - get16(s); // discard palette length - get8(s); // discard bits per palette color entry - get16(s); // discard x origin - get16(s); // discard y origin - if ( get16(s) < 1 ) return 0; // test width - if ( get16(s) < 1 ) return 0; // test height - sz = get8(s); // bits per pixel - if ( (sz != 8) && (sz != 16) && (sz != 24) && (sz != 32) ) return 0; // only RGB or RGBA or grey allowed - return 1; // seems to have passed everything -} - -static int stbi_tga_test(stbi *s) -{ - int res = tga_test(s); - stbi_rewind(s); - return res; -} - -static stbi_uc *tga_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - // read in the TGA header stuff - int tga_offset = get8u(s); - int tga_indexed = get8u(s); - int tga_image_type = get8u(s); - int tga_is_RLE = 0; - int tga_palette_start = get16le(s); - int tga_palette_len = get16le(s); - int tga_palette_bits = get8u(s); - int tga_x_origin = get16le(s); - int tga_y_origin = get16le(s); - int tga_width = get16le(s); - int tga_height = get16le(s); - int tga_bits_per_pixel = get8u(s); - int tga_inverted = get8u(s); - // image data - unsigned char *tga_data; - unsigned char *tga_palette = NULL; - int i, j; - unsigned char raw_data[4]; - unsigned char trans_data[4]; - int RLE_count = 0; - int RLE_repeating = 0; - int read_next_pixel = 1; - - // do a tiny bit of precessing - if ( tga_image_type >= 8 ) - { - tga_image_type -= 8; - tga_is_RLE = 1; - } - /* int tga_alpha_bits = tga_inverted & 15; */ - tga_inverted = 1 - ((tga_inverted >> 5) & 1); - - // error check - if ( //(tga_indexed) || - (tga_width < 1) || (tga_height < 1) || - (tga_image_type < 1) || (tga_image_type > 3) || - ((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16) && - (tga_bits_per_pixel != 24) && (tga_bits_per_pixel != 32)) - ) - { - return NULL; // we don't report this as a bad TGA because we don't even know if it's TGA - } - - // If I'm paletted, then I'll use the number of bits from the palette - if ( tga_indexed ) - { - tga_bits_per_pixel = tga_palette_bits; - } - - // tga info - *x = tga_width; - *y = tga_height; - if ( (req_comp < 1) || (req_comp > 4) ) - { - // just use whatever the file was - req_comp = tga_bits_per_pixel / 8; - *comp = req_comp; - } else - { - // force a new number of components - *comp = tga_bits_per_pixel/8; - } - tga_data = (unsigned char*)malloc( tga_width * tga_height * req_comp ); - if (!tga_data) return epuc("outofmem", "Out of memory"); - - // skip to the data's starting position (offset usually = 0) - skip(s, tga_offset ); - // do I need to load a palette? - if ( tga_indexed ) - { - // any data to skip? (offset usually = 0) - skip(s, tga_palette_start ); - // load the palette - tga_palette = (unsigned char*)malloc( tga_palette_len * tga_palette_bits / 8 ); - if (!tga_palette) return epuc("outofmem", "Out of memory"); - if (!getn(s, tga_palette, tga_palette_len * tga_palette_bits / 8 )) { - free(tga_data); - free(tga_palette); - return epuc("bad palette", "Corrupt TGA"); - } - } - // load the data - trans_data[0] = trans_data[1] = trans_data[2] = trans_data[3] = 0; - for (i=0; i < tga_width * tga_height; ++i) - { - // if I'm in RLE mode, do I need to get a RLE chunk? - if ( tga_is_RLE ) - { - if ( RLE_count == 0 ) - { - // yep, get the next byte as a RLE command - int RLE_cmd = get8u(s); - RLE_count = 1 + (RLE_cmd & 127); - RLE_repeating = RLE_cmd >> 7; - read_next_pixel = 1; - } else if ( !RLE_repeating ) - { - read_next_pixel = 1; - } - } else - { - read_next_pixel = 1; - } - // OK, if I need to read a pixel, do it now - if ( read_next_pixel ) - { - // load however much data we did have - if ( tga_indexed ) - { - // read in 1 byte, then perform the lookup - int pal_idx = get8u(s); - if ( pal_idx >= tga_palette_len ) - { - // invalid index - pal_idx = 0; - } - pal_idx *= tga_bits_per_pixel / 8; - for (j = 0; j*8 < tga_bits_per_pixel; ++j) - { - raw_data[j] = tga_palette[pal_idx+j]; - } - } else - { - // read in the data raw - for (j = 0; j*8 < tga_bits_per_pixel; ++j) - { - raw_data[j] = get8u(s); - } - } - // convert raw to the intermediate format - switch (tga_bits_per_pixel) - { - case 8: - // Luminous => RGBA - trans_data[0] = raw_data[0]; - trans_data[1] = raw_data[0]; - trans_data[2] = raw_data[0]; - trans_data[3] = 255; - break; - case 16: - // Luminous,Alpha => RGBA - trans_data[0] = raw_data[0]; - trans_data[1] = raw_data[0]; - trans_data[2] = raw_data[0]; - trans_data[3] = raw_data[1]; - break; - case 24: - // BGR => RGBA - trans_data[0] = raw_data[2]; - trans_data[1] = raw_data[1]; - trans_data[2] = raw_data[0]; - trans_data[3] = 255; - break; - case 32: - // BGRA => RGBA - trans_data[0] = raw_data[2]; - trans_data[1] = raw_data[1]; - trans_data[2] = raw_data[0]; - trans_data[3] = raw_data[3]; - break; - } - // clear the reading flag for the next pixel - read_next_pixel = 0; - } // end of reading a pixel - // convert to final format - switch (req_comp) - { - case 1: - // RGBA => Luminance - tga_data[i*req_comp+0] = compute_y(trans_data[0],trans_data[1],trans_data[2]); - break; - case 2: - // RGBA => Luminance,Alpha - tga_data[i*req_comp+0] = compute_y(trans_data[0],trans_data[1],trans_data[2]); - tga_data[i*req_comp+1] = trans_data[3]; - break; - case 3: - // RGBA => RGB - tga_data[i*req_comp+0] = trans_data[0]; - tga_data[i*req_comp+1] = trans_data[1]; - tga_data[i*req_comp+2] = trans_data[2]; - break; - case 4: - // RGBA => RGBA - tga_data[i*req_comp+0] = trans_data[0]; - tga_data[i*req_comp+1] = trans_data[1]; - tga_data[i*req_comp+2] = trans_data[2]; - tga_data[i*req_comp+3] = trans_data[3]; - break; - } - // in case we're in RLE mode, keep counting down - --RLE_count; - } - // do I need to invert the image? - if ( tga_inverted ) - { - for (j = 0; j*2 < tga_height; ++j) - { - int index1 = j * tga_width * req_comp; - int index2 = (tga_height - 1 - j) * tga_width * req_comp; - for (i = tga_width * req_comp; i > 0; --i) - { - unsigned char temp = tga_data[index1]; - tga_data[index1] = tga_data[index2]; - tga_data[index2] = temp; - ++index1; - ++index2; - } - } - } - // clear my palette, if I had one - if ( tga_palette != NULL ) - { - free( tga_palette ); - } - // the things I do to get rid of an error message, and yet keep - // Microsoft's C compilers happy... [8^( - tga_palette_start = tga_palette_len = tga_palette_bits = - tga_x_origin = tga_y_origin = 0; - // OK, done - return tga_data; -} - -static stbi_uc *stbi_tga_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - return tga_load(s,x,y,comp,req_comp); -} - - -// ************************************************************************************************* -// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB - -static int psd_test(stbi *s) -{ - if (get32(s) != 0x38425053) return 0; // "8BPS" - else return 1; -} - -static int stbi_psd_test(stbi *s) -{ - int r = psd_test(s); - stbi_rewind(s); - return r; -} - -static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - int pixelCount; - int channelCount, compression; - int channel, i, count, len; - int w,h; - uint8 *out; - - // Check identifier - if (get32(s) != 0x38425053) // "8BPS" - return epuc("not PSD", "Corrupt PSD image"); - - // Check file type version. - if (get16(s) != 1) - return epuc("wrong version", "Unsupported version of PSD image"); - - // Skip 6 reserved bytes. - skip(s, 6 ); - - // Read the number of channels (R, G, B, A, etc). - channelCount = get16(s); - if (channelCount < 0 || channelCount > 16) - return epuc("wrong channel count", "Unsupported number of channels in PSD image"); - - // Read the rows and columns of the image. - h = get32(s); - w = get32(s); - - // Make sure the depth is 8 bits. - if (get16(s) != 8) - return epuc("unsupported bit depth", "PSD bit depth is not 8 bit"); - - // Make sure the color mode is RGB. - // Valid options are: - // 0: Bitmap - // 1: Grayscale - // 2: Indexed color - // 3: RGB color - // 4: CMYK color - // 7: Multichannel - // 8: Duotone - // 9: Lab color - if (get16(s) != 3) - return epuc("wrong color format", "PSD is not in RGB color format"); - - // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.) - skip(s,get32(s) ); - - // Skip the image resources. (resolution, pen tool paths, etc) - skip(s, get32(s) ); - - // Skip the reserved data. - skip(s, get32(s) ); - - // Find out if the data is compressed. - // Known values: - // 0: no compression - // 1: RLE compressed - compression = get16(s); - if (compression > 1) - return epuc("bad compression", "PSD has an unknown compression format"); - - // Create the destination image. - out = (stbi_uc *) malloc(4 * w*h); - if (!out) return epuc("outofmem", "Out of memory"); - pixelCount = w*h; - - // Initialize the data to zero. - //memset( out, 0, pixelCount * 4 ); - - // Finally, the image data. - if (compression) { - // RLE as used by .PSD and .TIFF - // Loop until you get the number of unpacked bytes you are expecting: - // Read the next source byte into n. - // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally. - // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times. - // Else if n is 128, noop. - // Endloop - - // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data, - // which we're going to just skip. - skip(s, h * channelCount * 2 ); - - // Read the RLE data by channel. - for (channel = 0; channel < 4; channel++) { - uint8 *p; - - p = out+channel; - if (channel >= channelCount) { - // Fill this channel with default data. - for (i = 0; i < pixelCount; i++) *p = (channel == 3 ? 255 : 0), p += 4; - } else { - // Read the RLE data. - count = 0; - while (count < pixelCount) { - len = get8(s); - if (len == 128) { - // No-op. - } else if (len < 128) { - // Copy next len+1 bytes literally. - len++; - count += len; - while (len) { - *p = get8u(s); - p += 4; - len--; - } - } else if (len > 128) { - uint8 val; - // Next -len+1 bytes in the dest are replicated from next source byte. - // (Interpret len as a negative 8-bit int.) - len ^= 0x0FF; - len += 2; - val = get8u(s); - count += len; - while (len) { - *p = val; - p += 4; - len--; - } - } - } - } - } - - } else { - // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...) - // where each channel consists of an 8-bit value for each pixel in the image. - - // Read the data by channel. - for (channel = 0; channel < 4; channel++) { - uint8 *p; - - p = out + channel; - if (channel > channelCount) { - // Fill this channel with default data. - for (i = 0; i < pixelCount; i++) *p = channel == 3 ? 255 : 0, p += 4; - } else { - // Read the data. - for (i = 0; i < pixelCount; i++) - *p = get8u(s), p += 4; - } - } - } - - if (req_comp && req_comp != 4) { - out = convert_format(out, 4, req_comp, w, h); - if (out == NULL) return out; // convert_format frees input on failure - } - - if (comp) *comp = channelCount; - *y = h; - *x = w; - - return out; -} - -static stbi_uc *stbi_psd_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - return psd_load(s,x,y,comp,req_comp); -} - -// ************************************************************************************************* -// Softimage PIC loader -// by Tom Seddon -// -// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format -// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/ - -static int pic_is4(stbi *s,const char *str) -{ - int i; - for (i=0; i<4; ++i) - if (get8(s) != (stbi_uc)str[i]) - return 0; - - return 1; -} - -static int pic_test(stbi *s) -{ - int i; - - if (!pic_is4(s,"\x53\x80\xF6\x34")) - return 0; - - for(i=0;i<84;++i) - get8(s); - - if (!pic_is4(s,"PICT")) - return 0; - - return 1; -} - -typedef struct -{ - stbi_uc size,type,channel; -} pic_packet_t; - -static stbi_uc *pic_readval(stbi *s, int channel, stbi_uc *dest) -{ - int mask=0x80, i; - - for (i=0; i<4; ++i, mask>>=1) { - if (channel & mask) { - if (at_eof(s)) return epuc("bad file","PIC file too short"); - dest[i]=get8u(s); - } - } - - return dest; -} - -static void pic_copyval(int channel,stbi_uc *dest,const stbi_uc *src) -{ - int mask=0x80,i; - - for (i=0;i<4; ++i, mask>>=1) - if (channel&mask) - dest[i]=src[i]; -} - -static stbi_uc *pic_load2(stbi *s,int width,int height,int *comp, stbi_uc *result) -{ - int act_comp=0,num_packets=0,y,chained; - pic_packet_t packets[10]; - - // this will (should...) cater for even some bizarre stuff like having data - // for the same channel in multiple packets. - do { - pic_packet_t *packet; - - if (num_packets==sizeof(packets)/sizeof(packets[0])) - return epuc("bad format","too many packets"); - - packet = &packets[num_packets++]; - - chained = get8(s); - packet->size = get8u(s); - packet->type = get8u(s); - packet->channel = get8u(s); - - act_comp |= packet->channel; - - if (at_eof(s)) return epuc("bad file","file too short (reading packets)"); - if (packet->size != 8) return epuc("bad format","packet isn't 8bpp"); - } while (chained); - - *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel? - - for(y=0; ytype) { - default: - return epuc("bad format","packet has bad compression type"); - - case 0: {//uncompressed - int x; - - for(x=0;xchannel,dest)) - return 0; - break; - } - - case 1://Pure RLE - { - int left=width, i; - - while (left>0) { - stbi_uc count,value[4]; - - count=get8u(s); - if (at_eof(s)) return epuc("bad file","file too short (pure read count)"); - - if (count > left) - count = (uint8) left; - - if (!pic_readval(s,packet->channel,value)) return 0; - - for(i=0; ichannel,dest,value); - left -= count; - } - } - break; - - case 2: {//Mixed RLE - int left=width; - while (left>0) { - int count = get8(s), i; - if (at_eof(s)) return epuc("bad file","file too short (mixed read count)"); - - if (count >= 128) { // Repeated - stbi_uc value[4]; - int i; - - if (count==128) - count = get16(s); - else - count -= 127; - if (count > left) - return epuc("bad file","scanline overrun"); - - if (!pic_readval(s,packet->channel,value)) - return 0; - - for(i=0;ichannel,dest,value); - } else { // Raw - ++count; - if (count>left) return epuc("bad file","scanline overrun"); - - for(i=0;ichannel,dest)) - return 0; - } - left-=count; - } - break; - } - } - } - } - - return result; -} - -static stbi_uc *pic_load(stbi *s,int *px,int *py,int *comp,int req_comp) -{ - stbi_uc *result; - int i, x,y; - - for (i=0; i<92; ++i) - get8(s); - - x = get16(s); - y = get16(s); - if (at_eof(s)) return epuc("bad file","file too short (pic header)"); - if ((1 << 28) / x < y) return epuc("too large", "Image too large to decode"); - - get32(s); //skip `ratio' - get16(s); //skip `fields' - get16(s); //skip `pad' - - // intermediate buffer is RGBA - result = (stbi_uc *) malloc(x*y*4); - memset(result, 0xff, x*y*4); - - if (!pic_load2(s,x,y,comp, result)) { - free(result); - result=0; - } - *px = x; - *py = y; - if (req_comp == 0) req_comp = *comp; - result=convert_format(result,4,req_comp,x,y); - - return result; -} - -static int stbi_pic_test(stbi *s) -{ - int r = pic_test(s); - stbi_rewind(s); - return r; -} - -static stbi_uc *stbi_pic_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - return pic_load(s,x,y,comp,req_comp); -} - -// ************************************************************************************************* -// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb -typedef struct stbi_gif_lzw_struct { - int16 prefix; - uint8 first; - uint8 suffix; -} stbi_gif_lzw; - -typedef struct stbi_gif_struct -{ - int w,h; - stbi_uc *out; // output buffer (always 4 components) - int flags, bgindex, ratio, transparent, eflags; - uint8 pal[256][4]; - uint8 lpal[256][4]; - stbi_gif_lzw codes[4096]; - uint8 *color_table; - int parse, step; - int lflags; - int start_x, start_y; - int max_x, max_y; - int cur_x, cur_y; - int line_size; -} stbi_gif; - -static int gif_test(stbi *s) -{ - int sz; - if (get8(s) != 'G' || get8(s) != 'I' || get8(s) != 'F' || get8(s) != '8') return 0; - sz = get8(s); - if (sz != '9' && sz != '7') return 0; - if (get8(s) != 'a') return 0; - return 1; -} - -static int stbi_gif_test(stbi *s) -{ - int r = gif_test(s); - stbi_rewind(s); - return r; -} - -static void stbi_gif_parse_colortable(stbi *s, uint8 pal[256][4], int num_entries, int transp) -{ - int i; - for (i=0; i < num_entries; ++i) { - pal[i][2] = get8u(s); - pal[i][1] = get8u(s); - pal[i][0] = get8u(s); - pal[i][3] = transp ? 0 : 255; - } -} - -static int stbi_gif_header(stbi *s, stbi_gif *g, int *comp, int is_info) -{ - uint8 version; - if (get8(s) != 'G' || get8(s) != 'I' || get8(s) != 'F' || get8(s) != '8') - return e("not GIF", "Corrupt GIF"); - - version = get8u(s); - if (version != '7' && version != '9') return e("not GIF", "Corrupt GIF"); - if (get8(s) != 'a') return e("not GIF", "Corrupt GIF"); - - failure_reason = ""; - g->w = get16le(s); - g->h = get16le(s); - g->flags = get8(s); - g->bgindex = get8(s); - g->ratio = get8(s); - g->transparent = -1; - - if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments - - if (is_info) return 1; - - if (g->flags & 0x80) - stbi_gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1); - - return 1; -} - -static int stbi_gif_info_raw(stbi *s, int *x, int *y, int *comp) -{ - stbi_gif g; - if (!stbi_gif_header(s, &g, comp, 1)) { - stbi_rewind( s ); - return 0; - } - if (x) *x = g.w; - if (y) *y = g.h; - return 1; -} - -static void stbi_out_gif_code(stbi_gif *g, uint16 code) -{ - uint8 *p, *c; - - // recurse to decode the prefixes, since the linked-list is backwards, - // and working backwards through an interleaved image would be nasty - if (g->codes[code].prefix >= 0) - stbi_out_gif_code(g, g->codes[code].prefix); - - if (g->cur_y >= g->max_y) return; - - p = &g->out[g->cur_x + g->cur_y]; - c = &g->color_table[g->codes[code].suffix * 4]; - - if (c[3] >= 128) { - p[0] = c[2]; - p[1] = c[1]; - p[2] = c[0]; - p[3] = c[3]; - } - g->cur_x += 4; - - if (g->cur_x >= g->max_x) { - g->cur_x = g->start_x; - g->cur_y += g->step; - - while (g->cur_y >= g->max_y && g->parse > 0) { - g->step = (1 << g->parse) * g->line_size; - g->cur_y = g->start_y + (g->step >> 1); - --g->parse; - } - } -} - -static uint8 *stbi_process_gif_raster(stbi *s, stbi_gif *g) -{ - uint8 lzw_cs; - int32 len, code; - uint32 first; - int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear; - stbi_gif_lzw *p; - - lzw_cs = get8u(s); - clear = 1 << lzw_cs; - first = 1; - codesize = lzw_cs + 1; - codemask = (1 << codesize) - 1; - bits = 0; - valid_bits = 0; - for (code = 0; code < clear; code++) { - g->codes[code].prefix = -1; - g->codes[code].first = (uint8) code; - g->codes[code].suffix = (uint8) code; - } - - // support no starting clear code - avail = clear+2; - oldcode = -1; - - len = 0; - for(;;) { - if (valid_bits < codesize) { - if (len == 0) { - len = get8(s); // start new block - if (len == 0) - return g->out; - } - --len; - bits |= (int32) get8(s) << valid_bits; - valid_bits += 8; - } else { - int32 code = bits & codemask; - bits >>= codesize; - valid_bits -= codesize; - // @OPTIMIZE: is there some way we can accelerate the non-clear path? - if (code == clear) { // clear code - codesize = lzw_cs + 1; - codemask = (1 << codesize) - 1; - avail = clear + 2; - oldcode = -1; - first = 0; - } else if (code == clear + 1) { // end of stream code - skip(s, len); - while ((len = get8(s)) > 0) - skip(s,len); - return g->out; - } else if (code <= avail) { - if (first) return epuc("no clear code", "Corrupt GIF"); - - if (oldcode >= 0) { - p = &g->codes[avail++]; - if (avail > 4096) return epuc("too many codes", "Corrupt GIF"); - p->prefix = (int16) oldcode; - p->first = g->codes[oldcode].first; - p->suffix = (code == avail) ? p->first : g->codes[code].first; - } else if (code == avail) - return epuc("illegal code in raster", "Corrupt GIF"); - - stbi_out_gif_code(g, (uint16) code); - - if ((avail & codemask) == 0 && avail <= 0x0FFF) { - codesize++; - codemask = (1 << codesize) - 1; - } - - oldcode = code; - } else { - return epuc("illegal code in raster", "Corrupt GIF"); - } - } - } -} - -static void stbi_fill_gif_background(stbi_gif *g) -{ - int i; - uint8 *c = g->pal[g->bgindex]; - // @OPTIMIZE: write a dword at a time - for (i = 0; i < g->w * g->h * 4; i += 4) { - uint8 *p = &g->out[i]; - p[0] = c[2]; - p[1] = c[1]; - p[2] = c[0]; - p[3] = c[3]; - } -} - -// this function is designed to support animated gifs, although stb_image doesn't support it -static uint8 *stbi_gif_load_next(stbi *s, stbi_gif *g, int *comp, int req_comp) -{ - int i; - uint8 *old_out = 0; - - if (g->out == 0) { - if (!stbi_gif_header(s, g, comp,0)) return 0; // failure_reason set by stbi_gif_header - g->out = (uint8 *) malloc(4 * g->w * g->h); - if (g->out == 0) return epuc("outofmem", "Out of memory"); - stbi_fill_gif_background(g); - } else { - // animated-gif-only path - if (((g->eflags & 0x1C) >> 2) == 3) { - old_out = g->out; - g->out = (uint8 *) malloc(4 * g->w * g->h); - if (g->out == 0) return epuc("outofmem", "Out of memory"); - memcpy(g->out, old_out, g->w*g->h*4); - } - } - - for (;;) { - switch (get8(s)) { - case 0x2C: /* Image Descriptor */ - { - int32 x, y, w, h; - uint8 *o; - - x = get16le(s); - y = get16le(s); - w = get16le(s); - h = get16le(s); - if (((x + w) > (g->w)) || ((y + h) > (g->h))) - return epuc("bad Image Descriptor", "Corrupt GIF"); - - g->line_size = g->w * 4; - g->start_x = x * 4; - g->start_y = y * g->line_size; - g->max_x = g->start_x + w * 4; - g->max_y = g->start_y + h * g->line_size; - g->cur_x = g->start_x; - g->cur_y = g->start_y; - - g->lflags = get8(s); - - if (g->lflags & 0x40) { - g->step = 8 * g->line_size; // first interlaced spacing - g->parse = 3; - } else { - g->step = g->line_size; - g->parse = 0; - } - - if (g->lflags & 0x80) { - stbi_gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1); - g->color_table = (uint8 *) g->lpal; - } else if (g->flags & 0x80) { - for (i=0; i < 256; ++i) // @OPTIMIZE: reset only the previous transparent - g->pal[i][3] = 255; - if (g->transparent >= 0 && (g->eflags & 0x01)) - g->pal[g->transparent][3] = 0; - g->color_table = (uint8 *) g->pal; - } else - return epuc("missing color table", "Corrupt GIF"); - - o = stbi_process_gif_raster(s, g); - if (o == NULL) return NULL; - - if (req_comp && req_comp != 4) - o = convert_format(o, 4, req_comp, g->w, g->h); - return o; - } - - case 0x21: // Comment Extension. - { - int len; - if (get8(s) == 0xF9) { // Graphic Control Extension. - len = get8(s); - if (len == 4) { - g->eflags = get8(s); - get16le(s); // delay - g->transparent = get8(s); - } else { - skip(s, len); - break; - } - } - while ((len = get8(s)) != 0) - skip(s, len); - break; - } - - case 0x3B: // gif stream termination code - return (uint8 *) 1; - - default: - return epuc("unknown code", "Corrupt GIF"); - } - } -} - -static stbi_uc *stbi_gif_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - uint8 *u = 0; - stbi_gif g={0}; - - u = stbi_gif_load_next(s, &g, comp, req_comp); - if (u == (void *) 1) u = 0; // end of animated gif marker - if (u) { - *x = g.w; - *y = g.h; - } - - return u; -} - -static int stbi_gif_info(stbi *s, int *x, int *y, int *comp) -{ - return stbi_gif_info_raw(s,x,y,comp); -} - - -// ************************************************************************************************* -// Radiance RGBE HDR loader -// originally by Nicolas Schulz -#ifndef STBI_NO_HDR -static int hdr_test(stbi *s) -{ - const char *signature = "#?RADIANCE\n"; - int i; - for (i=0; signature[i]; ++i) - if (get8(s) != signature[i]) - return 0; - return 1; -} - -static int stbi_hdr_test(stbi* s) -{ - int r = hdr_test(s); - stbi_rewind(s); - return r; -} - -#define HDR_BUFLEN 1024 -static char *hdr_gettoken(stbi *z, char *buffer) -{ - int len=0; - char c = '\0'; - - c = (char) get8(z); - - while (!at_eof(z) && c != '\n') { - buffer[len++] = c; - if (len == HDR_BUFLEN-1) { - // flush to end of line - while (!at_eof(z) && get8(z) != '\n') - ; - break; - } - c = (char) get8(z); - } - - buffer[len] = 0; - return buffer; -} - -static void hdr_convert(float *output, stbi_uc *input, int req_comp) -{ - if ( input[3] != 0 ) { - float f1; - // Exponent - f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8)); - if (req_comp <= 2) - output[0] = (input[0] + input[1] + input[2]) * f1 / 3; - else { - output[0] = input[0] * f1; - output[1] = input[1] * f1; - output[2] = input[2] * f1; - } - if (req_comp == 2) output[1] = 1; - if (req_comp == 4) output[3] = 1; - } else { - switch (req_comp) { - case 4: output[3] = 1; /* fallthrough */ - case 3: output[0] = output[1] = output[2] = 0; - break; - case 2: output[1] = 1; /* fallthrough */ - case 1: output[0] = 0; - break; - } - } -} - -static float *hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - char buffer[HDR_BUFLEN]; - char *token; - int valid = 0; - int width, height; - stbi_uc *scanline; - float *hdr_data; - int len; - unsigned char count, value; - int i, j, k, c1,c2, z; - - - // Check identifier - if (strcmp(hdr_gettoken(s,buffer), "#?RADIANCE") != 0) - return epf("not HDR", "Corrupt HDR image"); - - // Parse header - for(;;) { - token = hdr_gettoken(s,buffer); - if (token[0] == 0) break; - if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; - } - - if (!valid) return epf("unsupported format", "Unsupported HDR format"); - - // Parse width and height - // can't use sscanf() if we're not using stdio! - token = hdr_gettoken(s,buffer); - if (strncmp(token, "-Y ", 3)) return epf("unsupported data layout", "Unsupported HDR format"); - token += 3; - height = strtol(token, &token, 10); - while (*token == ' ') ++token; - if (strncmp(token, "+X ", 3)) return epf("unsupported data layout", "Unsupported HDR format"); - token += 3; - width = strtol(token, NULL, 10); - - *x = width; - *y = height; - - *comp = 3; - if (req_comp == 0) req_comp = 3; - - // Read data - hdr_data = (float *) malloc(height * width * req_comp * sizeof(float)); - - // Load image data - // image data is stored as some number of sca - if ( width < 8 || width >= 32768) { - // Read flat data - for (j=0; j < height; ++j) { - for (i=0; i < width; ++i) { - stbi_uc rgbe[4]; - main_decode_loop: - getn(s, rgbe, 4); - hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp); - } - } - } else { - // Read RLE-encoded data - scanline = NULL; - - for (j = 0; j < height; ++j) { - c1 = get8(s); - c2 = get8(s); - len = get8(s); - if (c1 != 2 || c2 != 2 || (len & 0x80)) { - // not run-length encoded, so we have to actually use THIS data as a decoded - // pixel (note this can't be a valid pixel--one of RGB must be >= 128) - uint8 rgbe[4]; - rgbe[0] = (uint8) c1; - rgbe[1] = (uint8) c2; - rgbe[2] = (uint8) len; - rgbe[3] = (uint8) get8u(s); - hdr_convert(hdr_data, rgbe, req_comp); - i = 1; - j = 0; - free(scanline); - goto main_decode_loop; // yes, this makes no sense - } - len <<= 8; - len |= get8(s); - if (len != width) { free(hdr_data); free(scanline); return epf("invalid decoded scanline length", "corrupt HDR"); } - if (scanline == NULL) scanline = (stbi_uc *) malloc(width * 4); - - for (k = 0; k < 4; ++k) { - i = 0; - while (i < width) { - count = get8u(s); - if (count > 128) { - // Run - value = get8u(s); - count -= 128; - for (z = 0; z < count; ++z) - scanline[i++ * 4 + k] = value; - } else { - // Dump - for (z = 0; z < count; ++z) - scanline[i++ * 4 + k] = get8u(s); - } - } - } - for (i=0; i < width; ++i) - hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp); - } - free(scanline); - } - - return hdr_data; -} - -static float *stbi_hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp) -{ - return hdr_load(s,x,y,comp,req_comp); -} - -static int stbi_hdr_info(stbi *s, int *x, int *y, int *comp) -{ - char buffer[HDR_BUFLEN]; - char *token; - int valid = 0; - - if (strcmp(hdr_gettoken(s,buffer), "#?RADIANCE") != 0) { - stbi_rewind( s ); - return 0; - } - - for(;;) { - token = hdr_gettoken(s,buffer); - if (token[0] == 0) break; - if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; - } - - if (!valid) { - stbi_rewind( s ); - return 0; - } - token = hdr_gettoken(s,buffer); - if (strncmp(token, "-Y ", 3)) { - stbi_rewind( s ); - return 0; - } - token += 3; - *y = strtol(token, &token, 10); - while (*token == ' ') ++token; - if (strncmp(token, "+X ", 3)) { - stbi_rewind( s ); - return 0; - } - token += 3; - *x = strtol(token, NULL, 10); - *comp = 3; - return 1; -} -#endif // STBI_NO_HDR - -static int stbi_bmp_info(stbi *s, int *x, int *y, int *comp) -{ - int hsz; - if (get8(s) != 'B' || get8(s) != 'M') { - stbi_rewind( s ); - return 0; - } - skip(s,12); - hsz = get32le(s); - if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108) { - stbi_rewind( s ); - return 0; - } - if (hsz == 12) { - *x = get16le(s); - *y = get16le(s); - } else { - *x = get32le(s); - *y = get32le(s); - } - if (get16le(s) != 1) { - stbi_rewind( s ); - return 0; - } - *comp = get16le(s) / 8; - return 1; -} - -static int stbi_psd_info(stbi *s, int *x, int *y, int *comp) -{ - int channelCount; - if (get32(s) != 0x38425053) { - stbi_rewind( s ); - return 0; - } - if (get16(s) != 1) { - stbi_rewind( s ); - return 0; - } - skip(s, 6); - channelCount = get16(s); - if (channelCount < 0 || channelCount > 16) { - stbi_rewind( s ); - return 0; - } - *y = get32(s); - *x = get32(s); - if (get16(s) != 8) { - stbi_rewind( s ); - return 0; - } - if (get16(s) != 3) { - stbi_rewind( s ); - return 0; - } - *comp = 4; - return 1; -} - -static int stbi_pic_info(stbi *s, int *x, int *y, int *comp) -{ - int act_comp=0,num_packets=0,chained; - pic_packet_t packets[10]; - - skip(s, 92); - - *x = get16(s); - *y = get16(s); - if (at_eof(s)) return 0; - if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) { - stbi_rewind( s ); - return 0; - } - - skip(s, 8); - - do { - pic_packet_t *packet; - - if (num_packets==sizeof(packets)/sizeof(packets[0])) - return 0; - - packet = &packets[num_packets++]; - chained = get8(s); - packet->size = get8u(s); - packet->type = get8u(s); - packet->channel = get8u(s); - act_comp |= packet->channel; - - if (at_eof(s)) { - stbi_rewind( s ); - return 0; - } - if (packet->size != 8) { - stbi_rewind( s ); - return 0; - } - } while (chained); - - *comp = (act_comp & 0x10 ? 4 : 3); - - return 1; -} - -static int stbi_info_main(stbi *s, int *x, int *y, int *comp) -{ - if (stbi_jpeg_info(s, x, y, comp)) - return 1; - if (stbi_png_info(s, x, y, comp)) - return 1; - if (stbi_gif_info(s, x, y, comp)) - return 1; - if (stbi_bmp_info(s, x, y, comp)) - return 1; - if (stbi_psd_info(s, x, y, comp)) - return 1; - if (stbi_pic_info(s, x, y, comp)) - return 1; - #ifndef STBI_NO_HDR - if (stbi_hdr_info(s, x, y, comp)) - return 1; - #endif - // test tga last because it's a crappy test! - if (stbi_tga_info(s, x, y, comp)) - return 1; - return e("unknown image type", "Image not of any known type, or corrupt"); -} - -#ifndef STBI_NO_STDIO -int stbi_info(char const *filename, int *x, int *y, int *comp) -{ - FILE *f = fopen(filename, "rb"); - int result; - if (!f) return e("can't fopen", "Unable to open file"); - result = stbi_info_from_file(f, x, y, comp); - fclose(f); - return result; -} - -int stbi_info_from_file(FILE *f, int *x, int *y, int *comp) -{ - int r; - stbi s; - long pos = ftell(f); - start_file(&s, f); - r = stbi_info_main(&s,x,y,comp); - fseek(f,pos,SEEK_SET); - return r; -} -#endif // !STBI_NO_STDIO - -int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp) -{ - stbi s; - start_mem(&s,buffer,len); - return stbi_info_main(&s,x,y,comp); -} - -int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp) -{ - stbi s; - start_callbacks(&s, (stbi_io_callbacks *) c, user); - return stbi_info_main(&s,x,y,comp); -} - -#endif // STBI_HEADER_FILE_ONLY - -/* - revision history: - 1.33 (2011-07-14) - make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements - 1.32 (2011-07-13) - support for "info" function for all supported filetypes (SpartanJ) - 1.31 (2011-06-20) - a few more leak fixes, bug in PNG handling (SpartanJ) - 1.30 (2011-06-11) - added ability to load files via callbacks to accomidate custom input streams (Ben Wenger) - removed deprecated format-specific test/load functions - removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway - error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha) - fix inefficiency in decoding 32-bit BMP (David Woo) - 1.29 (2010-08-16) - various warning fixes from Aurelien Pocheville - 1.28 (2010-08-01) - fix bug in GIF palette transparency (SpartanJ) - 1.27 (2010-08-01) - cast-to-uint8 to fix warnings - 1.26 (2010-07-24) - fix bug in file buffering for PNG reported by SpartanJ - 1.25 (2010-07-17) - refix trans_data warning (Won Chun) - 1.24 (2010-07-12) - perf improvements reading from files on platforms with lock-heavy fgetc() - minor perf improvements for jpeg - deprecated type-specific functions so we'll get feedback if they're needed - attempt to fix trans_data warning (Won Chun) - 1.23 fixed bug in iPhone support - 1.22 (2010-07-10) - removed image *writing* support - stbi_info support from Jetro Lauha - GIF support from Jean-Marc Lienher - iPhone PNG-extensions from James Brown - warning-fixes from Nicolas Schulz and Janez Zemva (i.e. Janez (U+017D)emva) - 1.21 fix use of 'uint8' in header (reported by jon blow) - 1.20 added support for Softimage PIC, by Tom Seddon - 1.19 bug in interlaced PNG corruption check (found by ryg) - 1.18 2008-08-02 - fix a threading bug (local mutable static) - 1.17 support interlaced PNG - 1.16 major bugfix - convert_format converted one too many pixels - 1.15 initialize some fields for thread safety - 1.14 fix threadsafe conversion bug - header-file-only version (#define STBI_HEADER_FILE_ONLY before including) - 1.13 threadsafe - 1.12 const qualifiers in the API - 1.11 Support installable IDCT, colorspace conversion routines - 1.10 Fixes for 64-bit (don't use "unsigned long") - optimized upsampling by Fabian "ryg" Giesen - 1.09 Fix format-conversion for PSD code (bad global variables!) - 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz - 1.07 attempt to fix C++ warning/errors again - 1.06 attempt to fix C++ warning/errors again - 1.05 fix TGA loading to return correct *comp and use good luminance calc - 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free - 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR - 1.02 support for (subset of) HDR files, float interface for preferred access to them - 1.01 fix bug: possible bug in handling right-side up bmps... not sure - fix bug: the stbi_bmp_load() and stbi_tga_load() functions didn't work at all - 1.00 interface to zlib that skips zlib header - 0.99 correct handling of alpha in palette - 0.98 TGA loader by lonesock; dynamically add loaders (untested) - 0.97 jpeg errors on too large a file; also catch another malloc failure - 0.96 fix detection of invalid v value - particleman@mollyrocket forum - 0.95 during header scan, seek to markers in case of padding - 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same - 0.93 handle jpegtran output; verbose errors - 0.92 read 4,8,16,24,32-bit BMP files of several formats - 0.91 output 24-bit Windows 3.0 BMP files - 0.90 fix a few more warnings; bump version number to approach 1.0 - 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd - 0.60 fix compiling as c++ - 0.59 fix warnings: merge Dave Moore's -Wall fixes - 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian - 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available - 0.56 fix bug: zlib uncompressed mode len vs. nlen - 0.55 fix bug: restart_interval not initialized to 0 - 0.54 allow NULL for 'int *comp' - 0.53 fix bug in png 3->4; speedup png decoding - 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments - 0.51 obey req_comp requests, 1-component jpegs return as 1-component, - on 'test' only check type, not whether we support this variant - 0.50 first released version -*/ diff --git a/old/platforms/linux/Makefile b/old/platforms/linux/Makefile deleted file mode 100644 index 59124f3..0000000 --- a/old/platforms/linux/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# GNU Make solution makefile autogenerated by Premake -# Type "make help" for usage help - -ifndef config - config=debug -endif -export config - -PROJECTS := miners-app - -.PHONY: all clean help $(PROJECTS) - -all: $(PROJECTS) - -miners-app: - @echo "==== Building $@ ($(config)) ====" - @${MAKE} --no-print-directory -C . -f $@.make - -clean: - @${MAKE} --no-print-directory -C . -f miners-app.make clean - -help: - @echo "Usage: make [config=name] [target]" - @echo "" - @echo "CONFIGURATIONS:" - @echo " debug" - @echo " release" - @echo "" - @echo "TARGETS:" - @echo " all (default)" - @echo " clean" - @echo " $(PROJECT)" - @echo "" - @echo "For more information, see http://industriousone.com/premake/quick-start" diff --git a/old/platforms/linux/miners-app.make b/old/platforms/linux/miners-app.make deleted file mode 100644 index 32de23e..0000000 --- a/old/platforms/linux/miners-app.make +++ /dev/null @@ -1,182 +0,0 @@ -# GNU Make project makefile autogenerated by Premake -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -ifndef CC - CC = clang -endif - -ifndef CXX - CXX = clang++ -endif - -ifndef AR - AR = ar -endif - -ifndef RESCOMP - ifdef WINDRES - RESCOMP = $(WINDRES) - else - RESCOMP = windres - endif -endif - -PROJECT=miners - -ifeq ($(config),debug) - OBJDIR = obj/linux/debug/miners-app - TARGETDIR = ../../src/miners - TARGET = $(TARGETDIR)/miners-debug - DEFINES += -DGLM_FORCE_RADIANS -DDEBUG - INCLUDES += -I../../src/common -I../../src/common/thirdparty/glm -I../../src/common/thirdparty/stb_image - CPPFLAGS += -MMD -MP -std=c++1y $(DEFINES) $(INCLUDES) - CFLAGS += $(CPPFLAGS) $(ARCH) -g3 -Wall -Wextra - CXXFLAGS += $(CFLAGS) - LDFLAGS += - RESFLAGS += $(DEFINES) $(INCLUDES) - LIBS += -lGL -lglfw -lGLEW - LDDEPS += - LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS) - define PREBUILDCMDS - endef - define PRELINKCMDS - endef - define POSTBUILDCMDS - endef -endif - -ifeq ($(config),release) - OBJDIR = obj/linux/release/miners-app - TARGETDIR = ../../src/miners - TARGET = $(TARGETDIR)/miners-release - DEFINES += -DGLM_FORCE_RADIANS -DNDEBUG - INCLUDES += -I../../src/common -I../../src/common/thirdparty/glm -I../../src/common/thirdparty/stb_image - CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES) - CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -Wall - CXXFLAGS += $(CFLAGS) - LDFLAGS += -s - RESFLAGS += $(DEFINES) $(INCLUDES) - LIBS += -lGL -lglfw -lGLEW - LDDEPS += - LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(LIBS) $(LDFLAGS) - define PREBUILDCMDS - endef - define PRELINKCMDS - endef - define POSTBUILDCMDS - endef -endif - -OBJECTS := \ - $(OBJDIR)/main.o \ - $(OBJDIR)/Arguments.o \ - $(OBJDIR)/GlfwManager.o \ - $(OBJDIR)/Scene.o \ - $(OBJDIR)/Camera.o \ - $(OBJDIR)/Bitmap.o \ - $(OBJDIR)/Shader.o \ - $(OBJDIR)/Program.o \ - $(OBJDIR)/Texture.o \ - $(OBJDIR)/platform_linux.o \ - -RESOURCES := \ - -SHELLTYPE := msdos -ifeq (,$(ComSpec)$(COMSPEC)) - SHELLTYPE := posix -endif -ifeq (/bin,$(findstring /bin,$(SHELL))) - SHELLTYPE := posix -endif - -.PHONY: clean prebuild prelink - -all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) - @: - -$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES) - @echo Linking miners-app - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning miners-app -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: - $(PREBUILDCMDS) - -prelink: - $(PRELINKCMDS) - -ifneq (,$(PCH)) -$(GCH): $(PCH) - @echo $(notdir $<) -ifeq (posix,$(SHELLTYPE)) - -$(SILENT) cp $< $(OBJDIR) -else - $(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul -endif - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" -endif - -$(OBJDIR)/main.o: ../../src/miners/source/main.cc - @echo $(notdir $<) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/Arguments.o: ../../src/miners/source/Arguments.cc - @echo $(notdir $<) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/Scene.o: ../../src/miners/source/Scene.cc - @echo $(notdir $<) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/GlfwManager.o: ../../src/miners/source/GlfwManager.cc - @echo $(notdir $<) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/Camera.o: ../../src/common/tdogl/Camera.cpp - @echo $(notdir $<) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/Bitmap.o: ../../src/common/tdogl/Bitmap.cpp - @echo $(notdir $<) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/Shader.o: ../../src/common/tdogl/Shader.cpp - @echo $(notdir $<) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/Program.o: ../../src/common/tdogl/Program.cpp - @echo $(notdir $<) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/Texture.o: ../../src/common/tdogl/Texture.cpp - @echo $(notdir $<) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/platform_linux.o: platform_linux.cpp - @echo $(notdir $<) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" - --include $(OBJECTS:%.o=%.d) diff --git a/old/platforms/linux/platform_linux.cpp b/old/platforms/linux/platform_linux.cpp deleted file mode 100644 index 29fe577..0000000 --- a/old/platforms/linux/platform_linux.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#include "platform.hpp" -#include -#include -#include -#include - -#if defined( __APPLE_CC__ ) || defined ( __APPLE__ ) - #define PLATFORM_OSX - #include -#elif defined( __WIN32__ ) || defined( _WIN32 ) || defined( _WIN64 ) - #define PLATFORM_WIN32 - #include -#elif defined ( linux ) || defined( __linux__ ) - #define PLATFORM_LINUX - #include - #include -#elif defined( __HAIKU__ ) || defined( __BEOS__ ) - #define PLATFORM_HAIKU - #include - #include -#elif defined( __SVR4 ) - #define PLATFORM_SOLARIS - #include -#elif defined( __FreeBSD__ ) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined( __DragonFly__ ) - #define PLATFORM_BSD - #include -#endif - -static std::string GetProcessPath() { -#if defined( PLATFORM_OSX ) - char exe_file[PATH_MAX + 1]; - CFBundleRef mainBundle = CFBundleGetMainBundle(); - if (mainBundle) { - CFURLRef mainURL = CFBundleCopyBundleURL(mainBundle); - - if (mainURL) { - int ok = CFURLGetFileSystemRepresentation ( mainURL, (Boolean) true, (UInt8*)exe_file, PATH_MAX ); - - if (ok) { - return std::string(exe_file) + "/"; - } - } - } - - return "./"; -#elif defined( PLATFORM_LINUX ) - char exe_file[PATH_MAX + 1]; - int size; - size = readlink("/proc/self/exe", exe_file, PATH_MAX); - if (size < 0) { - return "./"; - } else { - exe_file[size] = '\0'; - return std::string(dirname(exe_file)) + "/"; - } -#elif defined( PLATFORM_WIN32 ) - // Get path to executable: - TCHAR szDllName[_MAX_PATH]; - TCHAR szDrive[_MAX_DRIVE]; - TCHAR szDir[_MAX_DIR]; - TCHAR szFilename[_MAX_DIR]; - TCHAR szExt[_MAX_DIR]; - GetModuleFileName(0, szDllName, _MAX_PATH); - - _splitpath(szDllName, szDrive, szDir, szFilename, szExt); - - return std::string(szDrive) + std::string(szDir); -#elif defined( PLATFORM_BSD ) - int mib[4]; - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_PATHNAME; - mib[3] = -1; - char buf[1024]; - size_t cb = sizeof(buf); - sysctl(mib, 4, buf, &cb, NULL, 0); - - return FileRemoveFileName( std::string( buf ) ); -#elif defined( PLATFORM_SOLARIS ) - return FileRemoveFileName( std::string( getexecname() ) ); -#elif defined( PLATFORM_HAIKU ) - image_info info; - int32 cookie = 0; - - while ( B_OK == get_next_image_info( 0, &cookie, &info ) ) { - if ( info.type == B_APP_IMAGE ) - break; - } - - return FileRemoveFileName( std::string( info.name ) ); -#else - #warning GetProcessPath() not implemented on this platform. ( will return "./" ) - return "./"; -#endif -} - -std::string ResourcePath(std::string fileName) { - return GetProcessPath() + "/resources/" + fileName; -} - diff --git a/old/platforms/linux/premake4.lua b/old/platforms/linux/premake4.lua deleted file mode 100644 index 3226e61..0000000 --- a/old/platforms/linux/premake4.lua +++ /dev/null @@ -1,56 +0,0 @@ -function create_project( name ) - project( name .. "-app" ) - kind "WindowedApp" - language "C++" - files { "../../src/" .. name .. "/source/**.cpp", "platform_linux.cpp" } - targetdir("../../src/" .. name .. "/") - includedirs( "../../src/common/" ) - includedirs( "../../src/common/thirdparty/glm" ) - includedirs( "../../src/common/thirdparty/stb_image" ) - defines { "GLM_FORCE_RADIANS" } - - configuration "windows" - links {"glu32", "opengl32", "gdi32", "winmm", "user32","GLEW"} - - configuration "linux" - links {"GL","glfw","GLEW"} - - configuration "macosx" - links {"GL","glfw","GLEW", "CoreFoundation.framework"} - libdirs {"/opt/local/lib"} - includedirs {"/opt/local/include"} - - configuration "haiku" - links {"GL","glfw","GLEW"} - - configuration "freebsd" - links {"GL","glfw","GLEW"} - - configuration "debug" - defines { "DEBUG" } - flags { "Symbols" } - buildoptions{ "-Wall" } - targetname ( name .. "-debug" ) - - configuration "release" - defines { "NDEBUG" } - flags { "Optimize" } - buildoptions{ "-Wall" } - targetname ( name .. "-release" ) -end - -solution "opengl-series" - location("./") - targetdir("./bin") - configurations { "debug", "release" } - objdir("obj/" .. os.get() .. "/") - - create_project( "miners-app" ); - --create_project( "01_project_skeleton" ); - --create_project( "02_textures" ); - --create_project( "03_matrices" ); - --create_project( "04_camera" ); - --create_project( "05_asset_instance" ); - --create_project( "06_diffuse_lighting" ); - --create_project( "07_more_lighting" ); - --create_project( "08_even_more_lighting" ); diff --git a/old/platforms/osx/platform_osx.mm b/old/platforms/osx/platform_osx.mm deleted file mode 100644 index 4760ddf..0000000 --- a/old/platforms/osx/platform_osx.mm +++ /dev/null @@ -1,15 +0,0 @@ -// -// Licensed under the terms in LICENSE.txt -// -// Copyright 2014 Tom Dalling. All rights reserved. -// - -#import "platform.hpp" -#import - -// returns the full path to the file `fileName` in the resources directory of the app bundle -std::string ResourcePath(std::string fileName) { - NSString* fname = [NSString stringWithCString:fileName.c_str() encoding:NSUTF8StringEncoding]; - NSString* path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:fname]; - return std::string([path cStringUsingEncoding:NSUTF8StringEncoding]); -} diff --git a/old/platforms/windows/04_camera.vcxproj b/old/platforms/windows/04_camera.vcxproj deleted file mode 100644 index 6a49ed9..0000000 --- a/old/platforms/windows/04_camera.vcxproj +++ /dev/null @@ -1,106 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {2AFCB852-7CC9-4B7A-A1C4-AF6565396B9C} - Win32Proj - - - - - - Application - true - v140 - - - Application - false - v140 - true - - - - - - - - - - - - - - - true - - - false - - - - - - Level3 - Disabled - WIN32;_CONSOLE;_LIB;%(PreprocessorDefinitions) - - - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - - - Console - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/old/platforms/windows/04_camera.vcxproj.filters b/old/platforms/windows/04_camera.vcxproj.filters deleted file mode 100644 index b0999f7..0000000 --- a/old/platforms/windows/04_camera.vcxproj.filters +++ /dev/null @@ -1,73 +0,0 @@ - - - - - {99b8bc00-eafd-4fc0-9f1c-e13f519249b5} - - - {e5fcabed-d60f-40b4-b87f-aa83b624adf5} - - - {1134d475-c4f8-45ca-9697-d447037cbb8a} - - - {13710458-7fe3-4eea-b3e2-18830915e250} - - - - - common - - - common - - - source\tdogl - - - source\tdogl - - - source\tdogl - - - source\tdogl - - - source\tdogl - - - source - - - - - source\tdogl - - - source\tdogl - - - source\tdogl - - - source\tdogl - - - source\tdogl - - - - - resources - - - resources - - - - - resources - - - \ No newline at end of file diff --git a/old/platforms/windows/glfw3.lib b/old/platforms/windows/glfw3.lib deleted file mode 100644 index 8070ae7a7e2722e744e02fd8686f74e0fdf7daaa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122534 zcmeFa3t&{$wKsky6NUhRM2w1pbre*5hlC)AG?ST3o-@fv5VQ(0gb7JZGHEiy!)hBE zg6133+E!a{AGcC%uYKEAE!I~M3fgLG)mp5N($=~qe{1Vgls z|M&fOa`vpV_F8+d{a*WdPQSFNr@8h0lP~f*&Aj>Z<`>T^D!O={6JMxa7hSxtSc2C~ zHVl``Fv5NRzE9s=!}v!(Ki_877<({pdO;re%Ye))*u z`sE{~rHuh!W1+v?S6y9KAMux$`_`}RXjtFWUELLr_N;5_2wt(QbWT~B&oD`YK7Y8r zrmC*I+P9)I)L6FE-`JVxh`04Nb#`||owOCcx=49#q`EdJXyI35FZ^z7j&;R*VjZc( z^_7+7^;H#h+T-rF4bhIqmRL_`Q`|{h<*N(Sl!rs%N=@9{6K#q|h2PN)DdaW2Ky|pL zzN$8)$y<7wI-{!-EiKWW#@?lsey9JnzN*S{e|063qcR!~Ziq*_dfQ@My$$i6wyw2l zsZ#5!srQF!D(lKd;Xpb$LkRgI<>gi3NM!{%0z&uz(gm`Y#SzHr-ZYl5&mX9+sI4!L zFczi7r6qN-(h`wKr6n?zdI==D);Plo`)bQ-LN#Ue)xL_RwvOn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6dqJSGxS*h_2B+_cQ8sd)!)&8CH!P7m zKIBN-=C&{xs4gw5DJ>0`2V6$rc5En6R30uX3!{7~to>VAi+^EJAXr^kQC?gW*1?u! zCLoI{i$kHRVgl_0d0Y70jZ{$Zj5gV|;wMNUM>Fs2JhmlA7}BGJG}H+Mejp zWzpPaQ*+fyG`}!|-Q}E{ohyNU?o~+^E7v~u$k8EtR=1UFKcF=ede_m7TvaU zBGanG=6GH1OyKA~Q#%h&%BD8`y6ZA@Q^hX*pj0jWplnE;L+1an)<{T+h=*tE`CFZu z3JwP3!eoBy_iE01 >}$IDC|jXCbtM++!VN@9dau8huEt}_hGZ3c%@C59PF^n*mG le|#y_7;>G1Z - -std::string ResourcePath(std::string fileName) { - char executablePath[1024] = {'\0'}; - DWORD charsCopied = GetModuleFileName(NULL, executablePath, 1024); - if(charsCopied > 0 && charsCopied < 1024) - return std::string(executablePath) + "\\..\\" + fileName; - else - throw std::runtime_error("GetModuleFileName failed a bit"); -} - diff --git a/old/platforms/windows/shared_build_settings.props b/old/platforms/windows/shared_build_settings.props deleted file mode 100644 index d125956..0000000 --- a/old/platforms/windows/shared_build_settings.props +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - $(SolutionDir)source\common\thirdparty\glfw\include;$(SolutionDir)source\common\thirdparty\glew\include;$(SolutionDir)source\common\thirdparty\glm;$(SolutionDir)source\common\thirdparty\stb_image;$(SolutionDir)source\common;$(IncludePath) - $(SolutionDir)platforms\windows;$(LibraryPath) - $(SolutionDir)Build\$(ProjectName)\$(Configuration)\ - $(SolutionDir)Build\$(ProjectName)\$(Configuration)\Intermediates\ - - - - glfw3.lib;opengl32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) - - - MultiThreadedDLL - GLEW_STATIC;GLM_FORCE_RADIANS;%(PreprocessorDefinitions) - - - copy "$(SolutionDir)source\$(ProjectName)\resources\*" "$(OutDir)\" - - - Copies resources into same directory as built executable - - - - \ No newline at end of file diff --git a/old/point.cc b/old/point.cc deleted file mode 100644 index 674d45a..0000000 --- a/old/point.cc +++ /dev/null @@ -1,29 +0,0 @@ -#include "point.h" - - -Point::Point(float &x_, float &y_, float &z_) { - this->x = x_; - this->y = y_; - this->z = z_; -} - -void -Point::setPoint(float &x_, float &y_, float &z_) { - this->x = x_; - this->y = y_; - this->z = z_; -} - -void -Point::setPoint(float x_, float y_, float z_) { - this->x = x_; - this->y = y_; - this->z = z_; -} - -void -Point::coordinates() { - std::cout << "x = " << this->x; - std::cout << "y = " << this->y; - std::cout << "z = " << this->z; -} diff --git a/old/point.h b/old/point.h deleted file mode 100644 index 57b7bd1..0000000 --- a/old/point.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef POINT_H -#define POINT_H - -#include -#include - -class Point { - -public: - Point(void) {} - Point(float &x, float &y, float &z); - ~Point() { - this->x = 0.0; - this->y = 0.0; - this->z = 0.0; - } - - Point& getPoint() { return *this; } - void setPoint(float &x, float &y, float &z); - void setPoint(float x, float y, float z); - void coordinates(); - -public: - float x, y, z; - -}; - -#endif diff --git a/old/points.c b/old/points.c deleted file mode 100644 index 61af0b7..0000000 --- a/old/points.c +++ /dev/null @@ -1,168 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include - -#include "shaders.hh" - -#define WIDTH 256 -#define HEIGHT 256 -#define DEPTH 256 -#define PIXL 4 - -struct content { - size_t height; - size_t width; - size_t depth; - size_t size; - GLuint program_id; - GLuint vertex_buffer_id; - GLuint vertex_colors_id; - GLfloat *vertex_buffer; - GLfloat *vertex_colors; -}; - -struct content *global_ctx; - -static struct content * -content_create() -{ - struct content *ctx = new struct content; - if (!ctx) { - return NULL; - } - ctx->width = WIDTH; - ctx->height = HEIGHT; - ctx->depth = DEPTH; - ctx->size = ctx->width * ctx->height * ctx->depth * 3; - ctx->vertex_buffer = new GLfloat[ctx->size * sizeof (GLfloat)]; - ctx->vertex_colors = new GLfloat[ctx->size * sizeof (GLfloat)]; - - if (!ctx->vertex_buffer || !ctx->vertex_colors) { - free(ctx->vertex_buffer); - free(ctx->vertex_colors); - free(ctx); - return NULL; - } - - return ctx; -} - -static bool -content_init(struct content *ctx) -{ - size_t pos = 0; - for (size_t x = 0; x < ctx->width; ++x) { - for (size_t y = 0; y < ctx->height; ++y) { - for (size_t z = 0; z < ctx->depth; ++z) { - size_t tmp = pos; - ctx->vertex_buffer[pos++] = (float)x - (float)ctx->width / 2; - ctx->vertex_buffer[pos++] = (float)y - (float)ctx->height / 2; - ctx->vertex_buffer[pos++] = (float)z - (float)ctx->depth / 2; - pos = tmp; - ctx->vertex_colors[pos++] = (float)x / (float)ctx->width; - ctx->vertex_colors[pos++] = (float)y / (float)ctx->height; - ctx->vertex_colors[pos++] = (float)z / (float)ctx->depth; - } - } - } - - glEnable(GL_VERTEX_ARRAY); - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LESS); - - glGenBuffers(1, &ctx->vertex_buffer_id); - glBindBuffer(GL_ARRAY_BUFFER, ctx->vertex_buffer_id); - glBufferData(GL_ARRAY_BUFFER, ctx->size * sizeof(GLfloat), ctx->vertex_buffer, GL_STATIC_DRAW); - - glGenBuffers(1, &ctx->vertex_colors_id); - glBindBuffer(GL_ARRAY_BUFFER, ctx->vertex_colors_id); - glBufferData(GL_ARRAY_BUFFER, ctx->size * sizeof(GLfloat), ctx->vertex_colors, GL_STATIC_DRAW); - - ctx->program_id = LoadShaders( "vertex.glsl", "fragment.glsl" ); - - return true; -} - -static void -display(void) { - struct content *ctx = global_ctx; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(90.0, 1, 0.1, 500.); - gluLookAt( - 0, 0, 0, - 0, 0, 0, - 0, 1, 0 - ); - - glUseProgram(ctx->program_id); - - glEnableClientState(GL_VERTEX_ARRAY); - - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); - glEnableVertexAttribArray(0); - glBindBuffer(GL_ARRAY_BUFFER, ctx->vertex_buffer_id); - glDrawArrays(GL_POINTS, 0, ctx->size / 3); - glDisableVertexAttribArray(0); - - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); - glEnableVertexAttribArray(1); - glBindBuffer(GL_ARRAY_BUFFER, ctx->vertex_colors_id); - glDisableVertexAttribArray(1); - - glDisableClientState(GL_VERTEX_ARRAY); - - glutSwapBuffers(); -} - - -static -void -keyboard(unsigned char key, int x, int y) { - (void) x; - (void) y; - switch (key) { - case 'q': - case 'Q': - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - -int -main(int argc, char *argv[]) { - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE); - glutInitWindowSize(3 * WIDTH, 3 * HEIGHT); - glutInitWindowPosition(10, 10); - glutCreateWindow("points"); - - GLenum GLEWinit = glewInit(); - if (GLEW_OK != GLEWinit) { - fprintf(stderr, "GLEW: %s\n", glewGetErrorString(GLEWinit)); - return 1; - } - - global_ctx = content_create(); - content_init(global_ctx); - - glutDisplayFunc(display); - glutKeyboardFunc(keyboard); - - printf("GL_VERSION = %s\n", glGetString(GL_VERSION)); - printf("GL_RENDERER = %s\n", glGetString(GL_RENDERER)); - - - glutMainLoop(); - return 0; -} diff --git a/old/shaders.hh b/old/shaders.hh deleted file mode 100644 index 0ea8a31..0000000 --- a/old/shaders.hh +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include - -GLuint -LoadShaders(const char * vertex_file_path, const char * fragment_file_path); diff --git a/old/vector3.h b/old/vector3.h deleted file mode 100644 index cbdee26..0000000 --- a/old/vector3.h +++ /dev/null @@ -1,143 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2012, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the following -conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------------- -*/ -/** @file aiVector3D.h - * @brief 3D vector structure, including operators when compiling in C++ - */ -#ifndef AI_VECTOR3D_H_INC -#define AI_VECTOR3D_H_INC - -#include - - -#include "./Compiler/pushpack1.h" - -#ifdef __cplusplus - -template class aiMatrix3x3t; -template class aiMatrix4x4t; - -// --------------------------------------------------------------------------- -/** Represents a three-dimensional vector. */ -template -class aiVector3t -{ -public: - - aiVector3t () : x(), y(), z() {} - aiVector3t (TReal _x, TReal _y, TReal _z) : x(_x), y(_y), z(_z) {} - explicit aiVector3t (TReal _xyz) : x(_xyz), y(_xyz), z(_xyz) {} - aiVector3t (const aiVector3t& o) : x(o.x), y(o.y), z(o.z) {} - -public: - - // combined operators - const aiVector3t& operator += (const aiVector3t& o); - const aiVector3t& operator -= (const aiVector3t& o); - const aiVector3t& operator *= (TReal f); - const aiVector3t& operator /= (TReal f); - - // transform vector by matrix - aiVector3t& operator *= (const aiMatrix3x3t& mat); - aiVector3t& operator *= (const aiMatrix4x4t& mat); - - // access a single element - TReal operator[](unsigned int i) const; - TReal& operator[](unsigned int i); - - // comparison - bool operator== (const aiVector3t& other) const; - bool operator!= (const aiVector3t& other) const; - - template - operator aiVector3t () const; - -public: - - /** @brief Set the components of a vector - * @param pX X component - * @param pY Y component - * @param pZ Z component */ - void Set( TReal pX, TReal pY, TReal pZ); - - /** @brief Get the squared length of the vector - * @return Square length */ - TReal SquareLength() const; - - - /** @brief Get the length of the vector - * @return length */ - TReal Length() const; - - - /** @brief Normalize the vector */ - aiVector3t& Normalize(); - - - /** @brief Componentwise multiplication of two vectors - * - * Note that vec*vec yields the dot product. - * @param o Second factor */ - const aiVector3t SymMul(const aiVector3t& o); - - TReal x, y, z; -} PACK_STRUCT; - - -typedef aiVector3t aiVector3D; - -#else - -struct aiVector3D { - - float x,y,z; -} PACK_STRUCT; - -#endif // __cplusplus - -#include "./Compiler/poppack1.h" - -#ifdef __cplusplus - - - -#endif // __cplusplus - -#endif // AI_VECTOR3D_H_INC diff --git a/old/vertex.glsl b/old/vertex.glsl deleted file mode 100644 index 95c4e45..0000000 --- a/old/vertex.glsl +++ /dev/null @@ -1,13 +0,0 @@ -#version 320 es - -layout(location = 0) in vec3 vertexBuffer; -layout(location = 1) in vec3 vertexColors; - -out vec3 fragmentColors; - -void main() { - gl_Position.xyz = vertexBuffer; - gl_Position.w = 1.0; - - fragmentColors = vertexColors; -}