Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - deltaphc

Pages: [1]
1
General discussions / Re: Games
« on: January 17, 2014, 09:17:14 pm »
To clarify some of the other responses:

SFML is a framework that lets you draw sprites and graphics in any manner that you choose. You can also play any kind of music and sound effects that you choose. It also has a networking module, which allows you to send and receive pretty much any kind of data that you want to/from a remote machine or server.

Basically, SFML only gives you access to graphics/sound/networking resources in a cross-platform way. It doesn't assume anything about what you actually do with those resources. It doesn't even have to be a game, technically. Could be a simulation. Could be embedded into a GUI application and used for rendering graphics for an editor. It's all completely up to you.

2
Ah, I see. Thanks.

I suppose then my next question would be of "proper" C++ style. I'm not entirely certain where I'm copying sf::Music (and other objects for that matter). It's used in the ResourceManager::music method. If I understand things correctly, it creates an instance of sf::Music when I insert into the std::map, which I then access using an object reference which should avoid copying, so maybe the problem is when it tries to find a music entry using std::map::find(). Would it be copying sf::Music when returning an iterator?

3
I have a ResourceManager class that basically maintains a cache of SFML objects. At compile-time, it's giving me this error:
Code: [Select]
1>  ResourceManager.cpp
1>d:\prog\libs\sfml-2.0-rc\include\sfml\system\mutex.hpp(89): error C2248: 'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable'
1>          d:\prog\libs\sfml-2.0-rc\include\sfml\system\noncopyable.hpp(67) : see declaration of 'sf::NonCopyable::NonCopyable'
1>          d:\prog\libs\sfml-2.0-rc\include\sfml\system\noncopyable.hpp(42) : see declaration of 'sf::NonCopyable'
1>          This diagnostic occurred in the compiler generated function 'sf::Mutex::Mutex(const sf::Mutex &)'
The thing I don't understand with this error is that I don't even use a Mutex anywhere in my code. I don't even use threading. And as far as I'm aware, all of the objects I use in ResourceManager (Texture, Music, Sound, Font) are all copyable and thus shouldn't generate this error as a side effect... that is, if I'm actually copying anything. I've tried to use object references where possible.

Some relevant source code;

ResourceManager.cpp:
http://pastebin.com/7YPtcEpH

ResourceManager.h:
http://pastebin.com/dNgBUejg

Common.h:
http://pastebin.com/YUcCQFwy

Level.h does not use any SFML types other than sf::Color.

Sorry about the amount of code. I wish I could isolate this further, but the compiler certainly isn't helping. I'm guessing that I'm missing something simple; I'm certainly no expert in all of C++'s little details.

I'm using the precompiled VS2010 package for SFML 2.0 RC. 32-bit compiler on Win7 x64.

4
C / Two issues I've come across
« on: January 27, 2009, 10:32:33 am »
Hello! Couldn't find these issues elsewhere, so I decided to register and post this.

At the top of my main.c:
Code: [Select]
#include <string.h>
#include <SFML/Audio.h>
#include <SFML/Graphics.h>
#include <physfs.h>


When I try to compile:
Code: [Select]
C:\dev\SFML-1.4\CSFML\include\SFML\Graphics\RenderWindow.h|51|error: redefinition of typedef 'sfRenderWindow'|
C:\dev\SFML-1.4\CSFML\include\SFML\Graphics\Image.h|36|error: previous declaration of 'sfRenderWindow' was here|
||=== Build finished: 2 errors, 0 warnings ===|


Using MinGW (GCC 4.3.2) and CodeBlocks. Any ideas?

Also, in the CSFML/lib/mingw/ folder in the C SDK, it appears that the filenames of the dynamic and static libraries are reversed. i.e. it's named libcsfml-audio.a when it should be audio-s, etc.

The regular C++ version works fine, but I just code in C as a personal preference. ;)

Pages: [1]