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.


Topics - Spirro

Pages: [1]
1
General / Interesting SFML related find...
« on: April 13, 2016, 11:11:02 pm »
I've been digging around the net on unrelated things, but found something today.   http://opendungeons.github.io/ lists SFML as a dependency and distributes the network, audio, and system SFML modules.  Rendering is done with Ogre and other libs for other things, but another example of SFMLs usefulness.

2
Graphics / I have been toying with sprites and textures and found an oddity
« on: November 14, 2015, 06:53:11 am »
I have been working on various things setting up for a small game program and came across something odd.  I am no an artist by any stretch so I found a placeholder graphic on opengameart to use as a ship, however I couldn't find a suitable size.  I thought scaling would be fine so I did so and plopped the sprite in the middle of the display and it looked off.  Thinking it had to do with the scaling I investigated a little.

The image is 150 by 120 pixels and the render area is 320 by 200.  I scaled the image by 0.5f for both width and height, placed it at what should be the center of the render area and printed out the screen render size, sprite global bound and local bounds in the console window.  What was odd to me is that the local bounds size of the sprite shows to be 150 width and 120 height, just as the original image, but the global shows as 60 width and 75 height.  Note that the values are inverted.  It should show as 75 width and 60 height.  I did make sure to recheck the code used and it seemed in the proper order.
Code: [Select]
    sf::FloatRect shipBounds;
    shipBounds = shipSprite.getLocalBounds();
    std::cout << "Ship local bounds size...X: " << shipBounds.width << " Y: " << shipBounds.height << std::endl;
    shipBounds = shipSprite.getGlobalBounds();
    std::cout << "Ship global bounds size...X: " << shipBounds.width << " Y: " << shipBounds.height << std::endl;

Note that shipSprite is defined as sf::Sprite higher up in the code.

Edit:  Sorry I forgot to put the version of SFML I used was compiled from the master branch on GIT.  2.3.x

3
C / CSFML dependencies
« on: February 12, 2015, 07:01:10 am »
I'm backtracking a bit from C++ to C so I thought I'd try out the CSFML binding.  I'm having a bit of a hard time translating the calls from SFML to CSFML, but searching the forums for code examples tends to get me solutions.  One thing I haven't found is that the current CSFML binding is to SFML2.1.  Not a problem I thought.  I downloaded the precompiled version from the download section and almost got everything working.

I'm playing with it on linux mint 17.1 and the CSFML binding is making calls to GLEW 1.5 and asking for libGLEW.so.1.5, but my this distro only has version 1.10.0-3 available.  I haven't yet looked into finding a lesser version on the libglew page mainly because going back and installing it may break a few things unless I took special effort to avoid that.  libjpeg.so.62 is also being called for by CSFML.  I can get that from the repository, but it removes the more current version of libjpeg from the system to do so, so again may break some things.  My compiled version of SFML 2.2 for one.

I was wondering if the CSFML binding is going to be updated soon since 2.2 is out, but I know that 2.3 is probably coming soon so it may be a bit of trouble to re-create the binding only to just turn around and do it again when 2.3 hits.

4
General / SFML, Code Lite, and static linking
« on: January 03, 2014, 01:52:01 am »
I asked a this a while back on the Code Lite forums, but haven't yet gotten a good response, probably due to the fact it is also SFML related.  I am wondering if anyone here uses Code Lite to code C++ with SFML.  On Windows I use Visual Studios and Code Blocks occasionally, but Code Blocks bugs me a bit.  I intend to be coding on Linux as well and Code Lite may suit me better in that respect.

What I am wondering is if anyone has had success statically linking SFML programs using Code Lite.  I can dynamically link with SFML on both OS and have no issues.  I would like to be able to statically link.  I know this is unnecessary on Linux as it has much better control of DLL files, but still it's something I would like to do.

I've set my libs to be sfml-graphics-s(-d) etc., but I can't figure out what to do with the SFML_STATIC setting required by both Visual Studios and Code Blocks.  If anyone has any insight in to this it would be greatly appreciated.

5
General / Trouble building SFML 2.0 snapshot with VS 2010 Pro(Fixed)
« on: June 06, 2012, 05:16:09 am »
Hello.  I am having trouble building the SFML 2.0 snapshot located on the download page.  I am trying to build it because I use Visual Studios 2010 Proffessional and there isn't already a package available for it.  I had been doing some research into graphics libs on youtube hoping to find something I liked and settled on trying SFML.  I found 2 videos there for building SFML with VS 2010 Express and gave them a try.

The first video, , uses cmake-gui to create a solution file that can be loaded into VS 2010.  Once made, you load the solution and create release/debug libraries then the author shows how to set up properties so that a project can compile using the new libraries.  After doing this I came across a problem in the linking phase of compilation(To be explained after I go over my attempts to resolve my issues).

The second video, http://www.youtube.com/watch?annotation_id=annotation_175195&src_vid=cDNo4bzrFW8&v=PtSDrLpV74M&feature=iv, uses cmake and nmake to create the libraries.  Again, after completing the steps in the video and trying a sample program I had problems.

Next I looked over the SFML site and found the tutorial on building SFML there(http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php) and followed it.  Then I went to the page(http://www.sfml-dev.org/tutorials/2.0/start-vc.php) detailing how to set up VS 2010 so that it can find the libraries and compile with them.  I again had problems after compilation and during the linking phase.  On the VS 2010 setup page a mention is made of using SFML_STATIC in the C/C++ preprossor when using static library builds.  I tried compilation with and without that setting while using the correct nomenclature of '-s' and '-s-d' on static builds and whatnot.

I have gone through many attempts at compilation of the sample program listed on the VS 2010 setup page using various settings for the project with no luck.  At best what it boils down to for me is this error:

MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

So, out of frustration I downloaded Code::Blocks and used my own install of MinGW from their website so that I was sure to have the most current version of the MinGW compiler system.  I went back to the page detailing how to create the libraries using CMake, made a make file for MinGW-make, and built the libraries.  I followed the instructions on this page(http://www.sfml-dev.org/tutorials/2.0/start-cb.php) to set up Code::Blocks and then compiles the example program at the bottom of the page.  It worked.  I had to copy the DLL files to my EXE file directory, but that was expected(and I didn't know how to go about making the static libs).

As you can see, I've tried many options to get SFML to compile under VS 2010 correctly, but I just can't get it to work.  I hear good things about Code::Blocks, but I'd rather use VS 2010(I bought the damn thing after all).  Any help would be appreciated.  If needed I can go through my setup processes again and get exact errors on the builds and post them here for further information.

**Sorry for the video link.  I've never made a post to a board that did things this way and I'm not sure why the second link didn't also create a video in this post.

EDIT - Forgot to mention I also tried compiling the current SVN files by converting the VS 2008 solution to VS 2010.  Again that failed me.

Pages: [1]
anything