support nvidia prime gpu offloading
This commit is contained in:
parent
5b55adfa6e
commit
4b8f28f70e
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
executable="$1"
|
||||
prime="prime-run"
|
||||
|
||||
if command -v $prime &> /dev/null
|
||||
then
|
||||
echo "launching $executable with nvidia prime offloading"
|
||||
$prime $executable
|
||||
else
|
||||
$executable
|
||||
fi
|
3
makefile
3
makefile
|
@ -17,6 +17,7 @@ SHADER_INCLUDES = $(shell find $(SHADER_INCLUDE_DIR) -name *.glsl)
|
|||
SHADER_TARGETS = $(SHADERS:$(SHADER_ROOT_DIR)/%.glsl=$(SHADER_TARGET_DIR)/%.compute)
|
||||
|
||||
TARGET = $(BIN_DIR)/oglc
|
||||
LAUNCH = "./launch"
|
||||
|
||||
CC = gcc
|
||||
LIBS = `pkg-config --static --libs glew sdl2 cglm`
|
||||
|
@ -47,6 +48,6 @@ clean:
|
|||
-rm */*.o
|
||||
|
||||
run: $(TARGET)
|
||||
$(TARGET)
|
||||
$(LAUNCH) $(TARGET)
|
||||
|
||||
.PHONY: run clean
|
||||
|
|
|
@ -48,9 +48,11 @@ SDL_Window* gfxInit(int width, int height)
|
|||
|
||||
// intiliased opengl
|
||||
|
||||
printf("%s\n", glGetString(GL_RENDERER));
|
||||
|
||||
int availableAttributes;
|
||||
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &availableAttributes);
|
||||
//printf("max vertex attributes %d\n", availableAttributes);
|
||||
printf("max vertex attributes %d\n", availableAttributes);
|
||||
|
||||
return sdlWindow;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue