Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wovo committed Sep 6, 2019
1 parent 8a866ff commit 99e2bd7
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 33 deletions.
23 changes: 13 additions & 10 deletions library/targets/hwlib-native-sfml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,18 @@ class window : public hwlib::window {
flush();
}

window( int x, int y, int m = 5 ): window( xy( x, y ), m ){}
window(
int x, int y,
color foreground = black,
color background = white,
int m = 5
): window( xy( x, y ), foreground, background, m ){}

window(
int x, int y, int m,
color foreground = black,
color background = white
): window( xy( x, y ), foreground, background, m ){}

void poll(){
if ( w.isOpen() ){
Expand Down Expand Up @@ -119,26 +130,18 @@ void wait_us_busy( int_fast32_t n ){
while( now_us() < end ){}
}

/*
void wait_ns( int_fast32_t n ){
wait_us( n / 1'000 );
}

void wait_us( int_fast32_t n ){
wait_us_busy( n );
}

void wait_ms( int_fast32_t n ){
wait_us( n * 1'000 );
}

uint_fast64_t now_us(){
return 0;
}
*/

void uart_putc( char c ){
std::cout << c << std::flush;
}
Expand Down
22 changes: 20 additions & 2 deletions makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,25 @@ HEADERS += targets/hwlib-native-linux.hpp
HEADERS += targets/hwlib-native-sfml.hpp
HEADERS += targets/hwlib-none.hpp

ifneq ($(wildcard $(HWLIB)/makefile.custom),)
include $(HWLIB)/makefile.custom
else ifneq ($(wildcard $(HWLIB)/../makefile.custom),)
include $(HWLIB)/../makefile.custom
else
include $(HWLIB)/makefile.local
endif

# add Catch
SEARCH += $(CATCH)/single_include/catch2

# add Boost
SEARCH += $(BOOST)

# add SFML
ifeq ($(TARGET),native)
ifeq ($(OS),Windows_NT)
SEARCH += $(HWLIB)/../SFML-2.5.1/include
LINKER_FLAGS += -L$(HWLIB)/../SFML-2.5.1/lib
SEARCH += $(SFML)/include
LINKER_FLAGS += -L$(SFML)/lib
LINKER_FLAGS += -lsfml-graphics-s -lsfml-window-s -lsfml-system-s
LINKER_FLAGS += -lopengl32 -lgdi32 -lws2_32 -lwinmm
DEFINES += -DSFML_STATIC
Expand All @@ -107,3 +122,6 @@ ifeq ($(TARGET),native)
DEFINES += -DSFML_STATIC
endif
endif

# defer to bmptk
include $(BMPTK)/makefile.inc
21 changes: 2 additions & 19 deletions makefile.link
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,5 @@ RELATIVE ?= .
# get the paths
HWLIB := $(RELATIVE)

ifneq ($(wildcard $(RELATIVE)/makefile.custom),)
include $(RELATIVE)/makefile.custom
else ifneq ($(wildcard $(RELATIVE)/../makefile.custom),)
include $(RELATIVE)/../makefile.custom
else
include $(RELATIVE)/makefile.local
endif

# add hwlib itself
include $(HWLIB)/makefile.inc

# add Catch
SEARCH += $(CATCH)/include

# set BMPTK to the bmptk subdirectory
BMPTK ?= $(HWLIB)/../bmptk

# defer to the bmptk makefile.inc
include $(BMPTK)/Makefile.inc
# defer to the makefile.inc
include $(HWLIB)/Makefile.inc
8 changes: 6 additions & 2 deletions makefile.local
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
BMPTK ?= $(RELATIVE)/../bmptk

# where to find Catch
CATCH := $(RELATIVE)/../Catch2
CATCH ?= $(RELATIVE)/../Catch2

SEARCH += $(RELATIVE)/../boost_1_69_0
# where to find Boost
BOOST ?= $(RELATIVE)/../boost_1_69_0

# where to find SFML (for windows)
SFML ?= $(RELATIVE)/../SFML-2.5.1-32

0 comments on commit 99e2bd7

Please sign in to comment.