Skip to content

Instantly share code, notes, and snippets.

View madebyjeffrey's full-sized avatar

Jeffrey Drake madebyjeffrey

View GitHub Profile
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();
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;
layout(location = 0) in vec4 position;
uniform mat4 viewportTranslation;
uniform mat4 projectionMatrix;
void main()
{
vec4 p2;
#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();
}
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));
//
// Object.cpp
// Spider-Fish
//
// Created by Jeffrey Drake on 11-09-29.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
// OpenGL Object
#include "Object.h"
//
// Object.cpp
// Spider-Fish
//
// Created by Jeffrey Drake on 11-09-29.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
// OpenGL Object
#include "Object.h"
Format of file:
Field: Entry
Eg.
Name: Triangle
Shader: triangle.vsh, triangle.fsh
Mesh: triangle.x
Vertices: <-0.5, -0.5, 0>,
void RenderInfo()
{
std::cout << "OpenGL Rendering Info" << std::endl;
if (glGetString(GL_VENDOR) == NULL)
{
std::cout << "No Vendor String" << std::endl;
return;
}
#!/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