From: Steinar H. Gunderson Date: Mon, 1 Oct 2012 10:13:07 +0000 (+0200) Subject: Change to C++. X-Git-Tag: 1.0~487 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=259227e2776ce4c6bea4ee164b4d9f2cfd4c7239 Change to C++. --- diff --git a/Makefile b/Makefile index 8e35cfa..5695c2e 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ CC=gcc +CXX=g++ CFLAGS=-std=gnu99 -Wall LDFLAGS=-lSDL -lSDL_image -lGL test: test.o - $(CC) -o test test.o $(LDFLAGS) + $(CXX) -o test test.o $(LDFLAGS) -.o: .c - $(CC) $(CXXFLAGS) $(CCFLAGS) -o $@ $< +.o: .cpp + $(CXX) $(CXXFLAGS) $(CCFLAGS) -o $@ $< clean: $(RM) test test.o diff --git a/test.c b/test.cpp similarity index 99% rename from test.c rename to test.cpp index 34027dc..c12cec6 100644 --- a/test.c +++ b/test.cpp @@ -556,7 +556,7 @@ int main(int argc, char **argv) SDL_GL_SwapBuffers(); check_error(); - unsigned char *screenbuf = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY); + unsigned char *screenbuf = (unsigned char *)glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY); check_error(); if (screenshot) { char filename[256];