Changeset db1b548 in opengl-game


Ignore:
Timestamp:
Feb 14, 2021, 8:07:22 PM (4 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
faa7bac
Parents:
6053b24
Message:

Add a makefile recipe for SDLGame

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • docs/README.txt

    r6053b24 rdb1b548  
    8989source setup-env.sh into your current shell
    9090
     91Actually, I think now this should work, after following the online instructions for installing Vulkan:
     92sudo apt-get install libglm-dev libsdl2-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-ttf-dev
     93
    9194make vulkangame && ./vulkangame
     95
     96For the sfml version: (these directions need verification)
     97
     98sudo apt-get install libglm-dev libsfml-dev
     99
     100Currently, the apt-get package doesn't have Vulkan support, so need to install from source as follows:
     101
     102Build the library yourself by following the instructions at https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php
     103
     104sudo apt-get install libfreetype-dev libx11-dev libxrandr-dev libudev-dev libopengl-dev libflac-dev libogg-dev libvorbis-dev libopenal-dev libpthread-stubs0-dev
     105
     106sudo apt-get install cmake-qt-gui
     107
     108Clone the sfml repo
    92109
    93110OSX
  • makefile

    r6053b24 rdb1b548  
    1818
    1919IMGUI_FILES = IMGUI/imgui.cpp IMGUI/imgui_demo.cpp IMGUI/imgui_draw.cpp IMGUI/imgui_widgets.cpp
     20IMGUI_IMPL_FILES =
    2021
    2122# If I were generating .o files as well, I should use $? instead of $^
     
    4243endif
    4344ifeq ($(OS),Linux)
    44         LIB_PATHS := -L$(VULKAN_SDK_PATH)/lib $(LIB_PATHS)
     45        LIB_PATHS =
    4546endif
    4647
     
    6869        $(CC) $(CXX_FLAGS) -o $@ $(SRC_FILES) $(LIB_FLAGS) -DGAMEGUI_INCLUDE_VULKAN
    6970
     71SRC_FILES = main-vulkan.cpp sdl-game.cpp crash-logger.cpp logger.cpp vulkan-utils.cpp game-gui-sdl.cpp IMGUI/imgui_impl_sdl.cpp IMGUI/imgui_impl_vulkan.cpp $(IMGUI_FILES)
     72HEADER_FILES = sdl-game.hpp crash-logger.hpp logger.hpp vulkan-utils.hpp game-gui.hpp game-gui-sdl.hpp IMGUI/imgui_impl_sdl.h IMGUI/imgui_impl_vulkan.h
     73
     74sdlgame: $(SRC_FILES) $(HEADER_FILES)
     75        $(CC) $(CXX_FLAGS) -o $@ $(SRC_FILES) $(LIB_FLAGS) -DGAMEGUI_INCLUDE_VULKAN
     76
     77#LIBS = `pkg-config --static --libs sfml-graphics sfml-window sfml-system`
     78# using pkg-config directly didn't add -s to the end of the sfml libs and since I only installed the static ones, g++ couldn't find them
     79#LIBS = -lvulkan -lsfml-graphics -lsfml-window -lsfml-system
     80
     81LIB_FLAGS = $(LIBS)
     82
     83#SRC_FILES = Vulkan.cpp vulkan-utils-new.cpp
     84#HEADER_FILES = vulkan-utils-new.hpp
     85
     86vulkansfmlref: $(SRC_FILES) $(HEADER_FILES)
     87        $(CC) $(CXX_FLAGS) -o $@ $(SRC_FILES) $(LIB_FLAGS)
     88
    7089.PHONY: shaders
    7190shaders:
     
    7594        rm -f openglref
    7695        rm -f vulkanref
     96        rm -f vulkansfmlref
    7797        rm -f openglgame
     98        rm -f sdlgame
    7899        rm -f vulkangame
    79100        rm -f shaders/*.spv
Note: See TracChangeset for help on using the changeset viewer.