Friday, October 25, 2013

opengl matrix, column major

When I implement lootat function with rotation and translation, I found out the opengl matrix is saved in column major, if you were using 1d array. 2d arrays are with the intuitive representations.

Thursday, October 24, 2013

Simple Makefile to compile and link all the cpp files in the folder

DEFINC := /usr/include/
LIBS := /usr/lib/
INC := $(DEFINC)


CXXFLAGS :=
CXXFLAGS = -I$(INC)
CXXFLAGS += -O2 -march=native
CXXFLAGS += -fPIC

LINK :=
LDFLAGS :=
LDFLAGS += -L$(LIBS) $(LINK)


CXX = g++
LD = g++

SRC := $(wildcard ./*.cpp)
OBJ := $(addprefix ./,$(notdir $(SRC:.cpp=.o)))
TARGET := test


all: $(TARGET)

$(TARGET): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^

obj/%.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<

clean :
rm -rf ./*.o $(TARGET)