Skip to content

Commit

Permalink
Try compile assets into executable
Browse files Browse the repository at this point in the history
  • Loading branch information
JustDoom committed Mar 26, 2024
1 parent 5221c6e commit f42e995
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ VERSION 0.1)

add_subdirectory(dependencies)
add_subdirectory(src)

file(COPY assets DESTINATION ${CMAKE_BINARY_DIR})

#install(DIRECTORY assets DESTINATION ${CMAKE_INSTALL_PREFIX})
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TextButton {
button.setSize(sf::Vector2f(width, height));
button.setPosition(sf::Vector2f(x, y));

font.loadFromFile("/home/doom/Downloads/font.ttf"); // Load your font here
font.loadFromFile("../assets/font.ttf"); // Load your font here
text.setFont(font);
text.setString(buttonText);
text.setCharacterSize(24); // Set your text size
Expand Down Expand Up @@ -75,7 +75,7 @@ int main(int argc, char** argv)

// sf::RenderWindow window(sf::VideoMode(640, 480), "8ChocChip - Chip8 Emulator");
//
// TextButton button(300, 200, 200, 80, "CLick!");
TextButton button(300, 200, 200, 80, "CLick!");
//
// while (window.isOpen()) {
// sf::Event event;
Expand Down

0 comments on commit f42e995

Please sign in to comment.