Skip to content

Instantly share code, notes, and snippets.

@jra101
jra101 / gist:5341926
Created April 9, 2013 00:38
Test using multiple sampler objects with a single texture object
bool TestSamplers()
{
GLuint c;
glGenRenderbuffers(1, &c);
glNamedRenderbufferStorageEXT(c, GL_RGBA8, 4, 1);
GLuint f;
glGenFramebuffers(1, &f);
glNamedFramebufferRenderbufferEXT(f, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, c);
bool TestVertexArrayObjects()
{
GLuint va;
glGenVertexArrays(1, &va);
glBindVertexArray(va);
glDeleteVertexArrays(1, &va);
GLubyte input[4] = { 219, 102, 88, 7 };
for (int i = 0; i < 2; i++) {
@jra101
jra101 / Makefile
Last active November 4, 2020 21:21
Minimal OpenGL on Linux
MAIN = triangle
CC = g++
CFLAGS = -DLINUX -std=c++0x -Wall -Wextra -Werror -g
LFLAGS = -lX11 -lGL
SRCS = main.cpp
OBJS = $(SRCS:.cpp=.o)
DEPS = $(OBJS:.o=.d)
all: $(MAIN)