This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template <typename T> | |
| struct tvec4 | |
| { | |
| enum ctor{null}; | |
| typedef T value_type; | |
| typedef std::size_t size_type; | |
| GLM_FUNC_DECL size_type length() const; | |
| static GLM_FUNC_DECL size_type value_size(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In file included from /Users/drakej/Projects/Spider-Fish/glfw-src/Spider-Fish/main.cpp:11: | |
| /Users/drakej/Projects/Spider-Fish/glfw-src/Spider-Fish/SpiderFish.h:40:21: error: implicit instantiation of undefined template 'std::__1::array<float, 4>' [3] | |
| array<float, 4> viewport; | |
| ^ | |
| /Developer/usr/bin/../lib/c++/v1/__tuple:66:59: note: template is declared here [3] | |
| template <class _Tp, size_t _Size> struct _LIBCPP_VISIBLE array; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| layout(location = 0) in vec4 position; | |
| uniform mat4 viewportTranslation; | |
| uniform mat4 projectionMatrix; | |
| void main() | |
| { | |
| vec4 p2; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "Shader.h" | |
| using namespace std; | |
| Shader::Shader() : program(0), shaders(vector<GLuint>()) | |
| { | |
| // do not create program here, because it will be initialized before gl context | |
| // program = glCreateProgram(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Object::draw() | |
| { | |
| shader.use(); | |
| GLuint var = shader.uniformLocation("projectionMatrix"); | |
| glUniformMatrix4fv(var, 1, GL_FALSE, glm::value_ptr(projectionMatrix)); | |
| var = shader.uniformLocation("viewportTranslation"); | |
| glUniformMatrix4fv(var, 1, GL_FALSE, glm::value_ptr(viewportTranslation)); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Object.cpp | |
| // Spider-Fish | |
| // | |
| // Created by Jeffrey Drake on 11-09-29. | |
| // Copyright (c) 2011 __MyCompanyName__. All rights reserved. | |
| // | |
| // OpenGL Object | |
| #include "Object.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Object.cpp | |
| // Spider-Fish | |
| // | |
| // Created by Jeffrey Drake on 11-09-29. | |
| // Copyright (c) 2011 __MyCompanyName__. All rights reserved. | |
| // | |
| // OpenGL Object | |
| #include "Object.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Format of file: | |
| Field: Entry | |
| Eg. | |
| Name: Triangle | |
| Shader: triangle.vsh, triangle.fsh | |
| Mesh: triangle.x | |
| Vertices: <-0.5, -0.5, 0>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void RenderInfo() | |
| { | |
| std::cout << "OpenGL Rendering Info" << std::endl; | |
| if (glGetString(GL_VENDOR) == NULL) | |
| { | |
| std::cout << "No Vendor String" << std::endl; | |
| return; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env runhaskell | |
| ε = 1.0e-7 | |
| -- sqrt(7) | |
| f x = x * x - 7 | |
| -- secant :: (a -> a) -> a -> a -> a | |
| secant f x = secant' f xLast x | |
| where xLast = x - 0.01 |