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 - amireldor

Pages: [1]
1
General / Re: Tutorial Segmentation Fault
« on: December 28, 2013, 03:04:07 am »
Solved.

I also had something like this, the application was segfaulting immediately. The backtrace showed something with virtualbox-dri.

I removed the installed guest additions (in my case, with aptitude), "inserted" the updated VirtualBox guest additions CD and installed them. Rebooted the guest machine, and now my application runs inside the VM :)

2
General / Re: sfml compile but dont show anything
« on: June 14, 2013, 02:49:23 pm »
What do you mean "it stopped after it ran half of the program"?
Did it finish compiling and building the project? Did you manage to compile a simple C++ "Hello World" application with CodeBlocks?

3
General / Re: Scene graphs, transformable and transform...
« on: June 14, 2013, 02:44:29 pm »
Hmm, yes Laurent, you're right I missed that. I'm posting the final code for the quick copy-paste coders that might bump into this thread.

sf::View view;
view.reset(sf::FloatRect(0, 0, map_width, map_height));
window.setView(view);


4
General / Re: Scene graphs, transformable and transform...
« on: June 14, 2013, 01:51:29 pm »
Alright, thanks for the help! Views it is.

I ended up using:

sf::View view;
view.reset(sf::FloatRect(0, 0, 320, 240));
view.setSize(320, 240);
window.setView(view);

Or more generally:

sf::View view;
view.reset(sf::FloatRect(0, 0, map_width, map_height));
view.setSize(map_width, map_height);
window.setView(view);
 

As I draw my sprites relative to 0, 0 and the edge of the scene is 320, 240.

If I understand correctly, I first reset the View to 'focus' on the (0, 0, 320, 240) of the whole scene, and then I set its size to 320x240 so it shows the whole (0, 0, 320, 240) rectangle (from the 'focus') on the View's viewport which is (0, 0, 1, 1) i.e. the whole screen. Thus I get the (0, 0, 320, 240) to the whole viewport. And all is scaled as I wanted.

5
General / Re: Scene graphs, transformable and transform...
« on: June 13, 2013, 12:49:16 am »
I thought about that, but a view only has zoom, and I need scale (I can't zoom differently for X and Y from what I read in the docs).

6
General / Re: Scene graphs, transformable and transform...
« on: June 13, 2013, 12:28:22 am »
Hello, is there a way to apply a render state to ALL `draw` calls?

I'm trying to scale the whole scene (sprite position and textures) to the window size. i.e. I have a 320x240 background texture and I draw a sprite at 100x100, and then I want to scale the whole scene to fit a 800x600 window.

Currently I have a RenderState with a scale transformation and I pass it to each draw call. It seems funny to do it this way though.

7
General / Unit testing with NetBeans + SFML is not nice to me
« on: April 25, 2012, 03:59:05 pm »
Hello.

Not sure if the SFML forums is the right place but as I already posted it in a NetBeans forums and got no answer - maybe someone here will have an idea.

NetBeans 7.1.1, Windows 7 64-bit, SFML 1.6

I'm trying to build a project that uses SFML and the built-in simple C++ unit test in NetBeans.

When I run a test, it compiles and links my files successfully, but when the tests should start, nothing happens. It just idles without any jobs pending on the bottom status bar and the message on the tests panel stays "Running tests, please wait...".

I managed to trace the problem to something with SFML. When I compile without any SFML code (i.e. all SFML code is commented out), the unit tests run. As soon as I compile using code from the SFML library (i.e. uncommenting even a single line of my SFML code), stuff goes wrong.

As I mentioned above, I posted a similar question on the NetBeans forums:
http://forums.netbeans.org/viewtopic.php?t=47710

Thanks for any help,
Amir

Pages: [1]