16
General / Re: LNK 1112 compiling SFML 2.0 to VS2012
« on: February 03, 2013, 04:49:21 pm »
That looks an awful lot like it's in the startup code that, among other things, initializes global variables before main is entered.
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.
couldn't this be made more efficient by just changing m_cache.viewChanged to true?
I am trying to load an image from file to use as a sprite, this worked in debug but not the release
So 1 Click with the mouse results in many "Pressed"-True values from my Input Class.
If I click on an Entity, and drag it over (or not for the first tests), I want a copy to be made and given to another list, wich is full of "world" sprites.
The drawn sprite is not shown correctly
I didn't want to cut out anything relevant (and trust me - I've cut out a lot already).
I my case the problem is with sf::RenderTexture (vide my last post's edit note). I don't see any sf::RenderTexture in your code.
QuoteSo both SFML and OpenGL treat in the lower left corner as 0, 0?OpenGL doesn't treat lower-left corner as (0, 0). It treats it like you tell him to treat it: it depends on many states that you set (projection matrix, texture coordinates, ... it also depends how you load your texture).
SFML generally treats the upper-left corner as (0, 0).
QuoteBecause inverting the y-coordinate and calling display() on the secondBuffer fixes the problem I gotIt's probably a side-effect, what you need is most likely a glFlush() (that's what display() does). And you won't have to invert Y coordinates anymore.
Wow thank you very much! That did the trick! I don't really understand why though. Would you mind explaining that to me? Because I don't actually touch the renderTexture secondBuffer (ie I never draw() to it) I always use firstBuffer, call display() on that one and then swap them.
You where also right about inverting the mouse y-coordinate. Why is that? I always though in texture coordinates the top left corner of a texture is (0, 0) is that wrong?
What are you saying? That I should rename the function or that I should not use events?
From what I now know off the top of my head I thought to just change while(window.pollEvent()) to if(window.pollEvent()) and that seems to fix this problem as expected, but does this make things less efficient? Every single example of a game loop I've seen always uses while(window.pollEvent()) and google doesn't have anything on this topic.
Everything works perfectly fine if I only use one rendertexture. But if I use two (or more) and swap the drawing between them the texture sometimes seems to be flipped along the x-axis (this appears randomly, sometimes there is a pattern, sometimes there's not...) Does anybody has a explanation for this and maybe a way that I can avoid it?