sfml

How to run SFML in CLion, Error undefined reference to?

不问归期 提交于 2020-07-17 10:47:31
问题 I'm new to C++ and try to learn game programming, I choose SFML and run on CLion by Jetbrain and using Ubuntu machine. I following this tutorial SFML and Linux here my code : #include <SFML/Graphics.hpp> using namespace sf; int main() { RenderWindow window(sf::VideoMode(200, 200), "SFML Work!"); CircleShape shape(100.f); shape.setFillColor(Color::Green); while (window.isOpen()) { Event event; while (window.pollEvent(event)) { if (event.type == Event::Closed) { window.close(); } } window.clear

How to run SFML in CLion, Error undefined reference to?

我们两清 提交于 2020-07-17 10:47:14
问题 I'm new to C++ and try to learn game programming, I choose SFML and run on CLion by Jetbrain and using Ubuntu machine. I following this tutorial SFML and Linux here my code : #include <SFML/Graphics.hpp> using namespace sf; int main() { RenderWindow window(sf::VideoMode(200, 200), "SFML Work!"); CircleShape shape(100.f); shape.setFillColor(Color::Green); while (window.isOpen()) { Event event; while (window.pollEvent(event)) { if (event.type == Event::Closed) { window.close(); } } window.clear

How to use a Manager class to manage Characters and their animations in C++ using the SFML library

跟風遠走 提交于 2020-06-29 05:16:40
问题 I'm trying to create a 2D sidescroller mini-game. For now, I only have a character with a sprite and one animation, which i'm trying to move using the left/right arrows. At first, I only had a Character class, storing the sprite of the character and its running animation. And it worked. But now, I'm trying to add a CharacterManager class, which will create all the characters to avoid doing it in the main, and which will manage their movements and draw them. And it doesn't work anymore. I

linking sfml with cmake (Windows MinGW)

允我心安 提交于 2020-06-27 17:49:27
问题 I can't seem to link SFML to my executable using cmake . CMakeLists.txt: cmake_minimum_required(VERSION 3.0.0) project(Tut3) set(LIBS_DIR ~/../../Libraries) add_executable(Tut3 main.cpp) set(CMAKE_MODULE_PATH ${LIBS_DIR}/sfml/cmake/Modules) find_package(SFML REQUIRED system window graphics) target_link_libraries(Tut3 ${SFML_LIBRARIES}) Error I get when running cmake: CMake Error at C:/Libraries/sfml/cmake/Modules/FindSFML.cmake:355 (message): Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY

SFML: undefined reference to _imp_ [closed]

坚强是说给别人听的谎言 提交于 2020-06-22 03:52:11
问题 Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Improve this question I'm trying to create a C++ application with SFML. Followed the tutorial, installed MinGW for Windows. My project has a main.cpp file in its root folder, and SFML is included in lib/sfml (relative to main.cpp). I can compile without problems with the command g++

Can run program with Mono but not with Visual Studio Mac

六月ゝ 毕业季﹏ 提交于 2020-05-16 03:19:09
问题 So I have a C# program that I'm making in Visual Studio Mac 2019. It uses the SFML.Net framework which depends on a dynamic library: libcsfml-graphics.2.5.0.dylib . Internally, the framework has a method called sfRenderWindow_createUnicode(...) . This method uses a DLLImport for CSFML.graphics . If I run the program in Visual Studio, I get a DllNotFoundException with message csfml-graphics . In my global config file for Mono, I have a DLL Mapping: <dllmap dll="csfml-graphics" target="libcsfml

SFML white rectangle

送分小仙女□ 提交于 2020-03-05 03:10:38
问题 I am trying to do a simple tile map. I have a problem: when I set up the map, there are only white squares. I'm normally loading the texture, so I don't know why it is like that. Here is the code: class Tile { private: sf::Sprite sprite; sf::Texture tex; public: Tile(int x, int y, sf::Texture tex) { this->tex = tex; this->sprite.setTexture(this->tex); this->sprite.setPosition(x, y); } void render(sf::RenderWindow* target) { target->draw(this->sprite); } class Tilemap { private: Tile tiles[36]

Using C++ templating for SFML Resource Manager

那年仲夏 提交于 2020-02-25 03:08:12
问题 I'm thinking of two solutions to create a resource manager for my SFML-Game. Both require templating (I'm new to templating), but I prefer one of those solutions, even if I don't really know how to make it work. I'd like to do something like this: std::map<string, class> resources; template<class T> T getResource(std::string name){ return (T) resources.find(name); } In other words, I'd like to have all my resources stored in one class, and that there is only one function to get a resource,

Using C++ templating for SFML Resource Manager

强颜欢笑 提交于 2020-02-25 03:07:31
问题 I'm thinking of two solutions to create a resource manager for my SFML-Game. Both require templating (I'm new to templating), but I prefer one of those solutions, even if I don't really know how to make it work. I'd like to do something like this: std::map<string, class> resources; template<class T> T getResource(std::string name){ return (T) resources.find(name); } In other words, I'd like to have all my resources stored in one class, and that there is only one function to get a resource,

Using C++ templating for SFML Resource Manager

人走茶凉 提交于 2020-02-25 03:05:44
问题 I'm thinking of two solutions to create a resource manager for my SFML-Game. Both require templating (I'm new to templating), but I prefer one of those solutions, even if I don't really know how to make it work. I'd like to do something like this: std::map<string, class> resources; template<class T> T getResource(std::string name){ return (T) resources.find(name); } In other words, I'd like to have all my resources stored in one class, and that there is only one function to get a resource,