sfml

The application failed to initialize properly (0xc0150002)

别等时光非礼了梦想. 提交于 2019-12-29 01:14:27
问题 I'm trying to compile an SFML program I've writting in Visual C++ 2010. It compiles fine, but when I run the executable I get this error: The application failed to initialize properly (0xc0150002). Click on OK to terminate the application. This happens every time I try to run an application that uses SFML, I have included the libraries that I used in the external dependances, the library and include libaries are all in the lib and include files in the VC folder and the DLL is in the same

SFML shader not working

两盒软妹~` 提交于 2019-12-25 09:28:15
问题 I'm trying to create a outline effect to my buttons when they are clicked but atm I'm just testing stuff with shaders... whenever I draw something with my shader tho it renders the shape completely black #include <SFML\Graphics.hpp> int main(){ sf::RenderWindow window(sf::VideoMode(500, 500), "hello world", sf::Style::Close); sf::RectangleShape rect; rect.setSize(sf::Vector2f(100, 100)); rect.setFillColor(sf::Color::Red); sf::Shader blur; if (!blur.loadFromFile("blur.frag", sf::Shader:

Iterating over and removing elements from a Vector. Error:Vector iterator not Incrementable

眉间皱痕 提交于 2019-12-25 08:52:24
问题 I'm trying to iterate over a vector of stored std::unique_ptr<Enemy> 's to check if they're colliding with the player 's attack. If they are, I want to delete the Enemy from the vector. However when I do this, I get the error: File: c:\program files (x86)\microsoft visual studio 14.0\vc\include\vector Line: 102 Expression: vector iterator not incrementable Here's the code: if(actionCnt > 0) { sf::FloatRect* playerAction = player->action(actionCnt); if (!enemies.empty()) { for (auto&i :

Can we make arrays or multidimensional arrays of sprites in SFML 2.1/C++?

百般思念 提交于 2019-12-25 02:44:27
问题 My question is very simple. Can we make an array of sprites or images in SFML. For example: int myArray[] = {1, 2, 3}; Consider index number one, two and three are three different images. How can we do it? Can anyone explain with some code example? 回答1: Yes you can! sf::Sprite array[10] = { ... } 来源: https://stackoverflow.com/questions/20932939/can-we-make-arrays-or-multidimensional-arrays-of-sprites-in-sfml-2-1-c

Undefined reference to impl

99封情书 提交于 2019-12-25 01:27:54
问题 I'm getting errors setting up SFML on Eclipse. I was following the instructions perfectly but I'm still getting these errors. I've tried TDM SJLJ and MinGW DW2 - both give different undefined references. I am linking dynamically with the sfml libraries, and I've set the path to the libraries correctly. Here's one that I'm getting: undefined reference to `_imp___ZN2sf6Window5closeEv' SFMLHelloWorld.cpp /SFMLHelloWorld/src line 15 C/C++ Problem All of the undefined references have the prefix

fatal error: SFML/System.hpp' file not found

丶灬走出姿态 提交于 2019-12-24 23:23:28
问题 I am trying to work with SMFL, CMAKE & VSCode. Cmake cannot link these SFML files. I install SFML & CMake using Homebrew. I have tried including the SFML files with SMFL_ROOT & SFML_INCLUDE_DIR to no avail. cmake_minimum_required(VERSION 3.14.2) project(WordTypeCpp VERSION 0.1.0 ) set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) set(CMAKE_CXX_STANDARD 17) find_package(SFML REQUIRED COMPONENTS graphics system) if (SFML_FOUND) set(SFML_ROOT "/usr/local

Using Vulkan with SFML?

守給你的承諾、 提交于 2019-12-24 19:33:27
问题 Im currently using GLFW for window creation and user input. GLFW simply allows us to say: glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); To tell GLFW were not working with OpenGL. It even provides function like glfwCreateWindowSurface(...) To automate window surface creation for different platforms. Is there any way I can do something similar with SFML? I could not find any information about it on their website, so i assume the answer is no. But maybe there is some kind of hack, or is this not

C++ SFML with MinGW version 8.2.0 and Atom text editor

大憨熊 提交于 2019-12-24 19:08:15
问题 I am trying to learn to make 2d games using c++ with the SFML library. I am using windows, but I would prefer to use the Atom text editor instead of Visual Studio. I did a lot of research on how to do this, but I still do not know how to use the SFML library with Atom. So, how would I go about implementing the SFML library in my c++ project written in Atom. Thank you! 回答1: This answer supposes that you've downloaded the 32-bit MinGW version of SFML, and you'd like to compile programs written

SFML load, modify, display bitmap

喜夏-厌秋 提交于 2019-12-24 09:27:01
问题 I had to work all day to figure out how to load, modify, and display a bitmap. Here's my working program (Lubuntu, CodeBlocks 16.01). I had to add these libraries:-lsfml-graphics,-lsfml-window, and -lsfml-system to project> build options> linker settings> other linker options. Any suggestions for improvements? #include <SFML/Graphics.hpp> using namespace std; using namespace sf; struct pix { unsigned char r; // could use Uint8 unsigned char g; unsigned char b; unsigned char t; }; // globals

Strange SFML behavior

本小妞迷上赌 提交于 2019-12-24 08:20:42
问题 I'm currently trying to write a button class. It takes 2 textures, m_texture and m_onHover , and its caption, which should be automatically centered. The function update() takes care of selecting the correct texture. class button : public sf::Drawable { private: const sf::Texture *m_texture; const sf::Texture *m_onHover; sf::Sprite m_sprite; public: button(); sf::Text m_caption; // public to allow easy formating, see centerCaption() bool mouseIsOver() const; void update(); void setPosition(sf