sfml

Unhandled exception at 0x777122D2 (ntdll.dll) in ArticxEngine.exe: 0xC0000005: Access violation writing location 0x00000004

流过昼夜 提交于 2019-12-07 19:41:32
问题 I'm completely unsure of why I'm getting this error in VS2012 when I run my program. Visual Studio seemed to direct the problem towards sf::RenderWindow Articx::window; in Articx.cpp Unhandled exception at 0x777122D2 (ntdll.dll) in ArticxEngine.exe: 0xC0000005: Access violation writing location 0x00000004. Code Articx.h #pragma once #include <SFML/Graphics.hpp> #include <SFML/Window.hpp> class Articx { public: static void Start(); private: static void GameLoop(); static bool isExiting(); enum

Repeating texture to fit certain size in SFML

不想你离开。 提交于 2019-12-07 06:20:07
问题 I have a file that contains textures. I load it to sf::Texture and split into sprites with setTextureRect . Now lets say one sprite contains part of texture that is 20 pixels wide. How can I render it to fit width of e.g. 213 pixels. The only way I can think about is to render it to sf::RenderTexture and crop it with another sprite. Is there a better way to do this? 回答1: You can use sf::Texture::setRepeated to do that. However, you'll need to copy that part of your bigger image into an

Removing Sprites from vector in sfml 2.1

会有一股神秘感。 提交于 2019-12-07 05:54:24
I'm trying to remove sprites from a vector, but to no avail and I don't know what's wrong(VS 2010 with SFML 2.1). It simply doesn't compile. Any tips appreciated. Its this line, that seems problematic: SpriteVector.erase(std::remove(SpriteVector.begin(), SpriteVector.end(), SpriteIt), SpriteVector.end()); Full code: #include <SFML/Graphics.hpp> #include <iostream> #include <vector> #include <algorithm> int main() { sf::RenderWindow mMainWindow(sf::VideoMode(1200, 900), "Map"); mMainWindow.setFramerateLimit(60); sf::RectangleShape rect; rect.setSize(sf::Vector2f(1500, 500)); sf::Texture

SFML not linking statically to openal32 (links statically to all other dependencies)

我是研究僧i 提交于 2019-12-07 01:30:59
问题 I compiled SFML using CMake for MinGW. After running "mingw32-make install" everything is built and installed with no errors. But when running the examples - pong.exe, sound.exe, sound-capture.exe and voip.exe all depend upon openal32.dll . I specified SFML_USE_STATIC_LIBS = true when configuring CMake and all other dependencies of the example executables are only upon native windows dlls. Can anyone explain why it has dynamically linked to openal32 (but nothing else)? Edit: I just came

Applying a blur shader to sf::RectangleShape

随声附和 提交于 2019-12-06 15:40:48
I have an object that is a 2d array of sf::RectangleShapes (for a tile-based game). It's supposed to look like a cloud, so I want to add some blur to it. Here is what it looks like now: And I want it to look like this: Instinctively, it seems to achieve this blur effect on the low level, I would have to draw the cloud object to a buffer, and then apply the blur object to the buffer. But I'm not sure if SFML is doing this already. In my main loop, I have this: for( CloudIterator it = clouds.begin(); it != clouds.end(); it++ ) { window.draw(**it); } Which I hope to replace with: for(

Making a SFML2 Applcation with Clang, libc++ and c++11. Undefined Reference to SFML Library

╄→гoц情女王★ 提交于 2019-12-06 13:20:30
I'm having a weird problem with making an SFML2 application. I'm using Clang++ from the Repositories as well as libc++ (both updated today). SFML2 was also updated from the SVN repo. I'm using the latest version of Kubuntu. I also had the same problem when I last tried about a month ago with the then up-to-date repositories. The parameters I'm passing through to the compiler for c++11 and stdlib are: -std=c++11 -stdlib=libc++ Here's the full version of what I'm calling: clang++ -std=c++11 -stdlib=libc++ main2.cpp -o main -L/home/jonathan/OpenSource/sfml/SFML-Build/lib/ -I/home/jonathan

Unhandled exception at 0x777122D2 (ntdll.dll) in ArticxEngine.exe: 0xC0000005: Access violation writing location 0x00000004

大憨熊 提交于 2019-12-06 08:43:54
I'm completely unsure of why I'm getting this error in VS2012 when I run my program. Visual Studio seemed to direct the problem towards sf::RenderWindow Articx::window; in Articx.cpp Unhandled exception at 0x777122D2 (ntdll.dll) in ArticxEngine.exe: 0xC0000005: Access violation writing location 0x00000004. Code Articx.h #pragma once #include <SFML/Graphics.hpp> #include <SFML/Window.hpp> class Articx { public: static void Start(); private: static void GameLoop(); static bool isExiting(); enum ScreenState {before, splash1, splash2, splash3, menu, pause, playing, exit}; static ScreenState

How to make a shader fade to a color?

ε祈祈猫儿з 提交于 2019-12-05 21:46:11
This is the current shader I am using. It fades the object by slowly reducing the opacity. I want to fade to purple. How can this be done? shader.frag: uniform sampler2D texture; uniform float opacity; void main() { vec4 pixel = texture2D(texture, gl_TexCoord[0].xy); gl_FragColor = pixel * vec4(1.0, 1.0, 1.0, opacity); } shader.vert: void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; gl_FrontColor = gl_Color; } application of shader in main function: sf::Shader shader; if (!shader.loadFromFile("shader.vert", "shader

How can I share my SFML game with others without errors?

天大地大妈咪最大 提交于 2019-12-05 19:38:29
So, I finished a game in C ++ / SFML and I would like to send it to someone but when I send it there are errors: I tested the exe on another computer with SFML DLLs required and it shows me that libstdc ++ - 6.dll is missing, so I added it and I tried again and it tells me that there are still other dll missing, it is very embarrassing. How can I share my game without all those errors and missing DLLs? You could use Dependency Walker (depends.exe) to find all the dll-s your application is using. It will still require some trial and error cycles to discover the ones you need, but at least you

SFML Bounding Box Collision Detection

微笑、不失礼 提交于 2019-12-05 19:20:30
I am trying to write a very basic game for my first SFML project. Its a robot with a jointed arm that will be able to pop balloons with his hand only. The problem I am having is that when checking to see if the pincer sprite intersects with the balloon sprite , it returns true all the time, regardless of the placement of the balloon or the robot pincer. I am using transform to place the various parts of the robot arm, and this is whats causing the problem I think, but I don't know why. I have tried using bounding box collision in a separate program where transform is not used and it worked