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

Pages: [1]
1
Graphics / Re: DisplayingSprites using classes(tutorial help)
« on: April 13, 2012, 11:24:45 pm »
Problem now is its telling me there is an undefined reference to sf::Image, most likely me just missing something obvious. Thanks for the help
The undefined reference means there is a linking problem. You want to make sure you are linking the correct SFML library files in the linker options of whatever IDE you're using. Check out the Getting Started tutorials for how to set up the libs.

2
Graphics / Re: DisplayingSprites using classes(tutorial help)
« on: April 13, 2012, 07:49:37 am »
Code: [Select]
int main()
{
    sf::RenderWindow Window(sf::VideoMode(800,600,32), "TANKWARS");
    Tank Playerone = Tank();               // calls default constructor to create a local instance
    if(!Playerone.LoadFile("Tank.tga"))
        return EXIT_FAILURE;
}

Oh, and as you are making the sf::Image static, you should remove "Image(Copy.Image)" from the copy constructor since there is no need to copy it (and it would cause a compiler error I believe). And the rest should be ok I think but I can't be sure since I'm using SFML 2.0 and can't test. Hope it works.  :)

3
Graphics / Re: DisplayingSprites using classes(tutorial help)
« on: April 13, 2012, 01:06:22 am »
I'm assuming you're following along to the 1.6 sprite tutorial and a few things caught my eye.

1. In main, I believe you're calling your Tank's copy constructor and it's passing in itself. You should just be calling the default constructor. Does it compile currently?
2. Make sure the sf::Image inside of the Tank class is static to avoid creating a new sf::Image each time you instantiate a Tank. You normally only want one sf::Image that is shared by every Tank instance.
3. To load an image, your Tank class needs to know what to load and have a way to load it. So one option is to have a public init method in your Tank class where you pass in the path of the file to load as a string, and within that method, you call the static sf::Image's file load method. Then the first time you create a Tank (inside of main in this case), you would subsequently call the init method as well to load the image.

Hope that helps.  :)

4
Graphics / Re: Deleting Images
« on: April 13, 2012, 12:18:07 am »
Storing a pointer in a vector doesn't affect what the pointer points to. Did you create the sf::Image on the heap using new within the loop?

5
SFML projects / Re: SFML Light System - Let There Be Light
« on: April 12, 2012, 06:34:18 am »
Just wondering. Does this work for Code::Blocks?  Not sure if this was mentioned yet or not.
Also is there anything else to download that is needed for your lib to run?  Just wondering since a while back I downloaded this and not even the examples worked for some reason.

I'm running it on Code::Blocks just fine with MinGW (gcc 4.6.1). You just have to link SFML and GLEW (included with SFML source). Didn't need anything extra.

6
Graphics / Re: Jagged edges on fonts
« on: April 11, 2012, 08:23:07 am »
Here is the font. Thanks for taking a look.

http://www.urbanfonts.com/fonts/Elements.htm

7
Graphics / Jagged edges on fonts
« on: April 11, 2012, 07:44:07 am »
I'm using SMFL2 and the fonts are rendering with jagged edges as if they're not smoothed. It happens with any font. I tried searching for an answer and the closest topic I found was http://en.sfml-dev.org/forums/index.php?topic=6447.msg42613#msg42613
Unfortunately, the link Laurent gave isn't redirecting to the new forum, so I'm not sure where to go from here.  :-\


8
SFML projects / Re: SFML Light System - Let There Be Light
« on: April 10, 2012, 05:11:13 am »
The newest version of SFML defaults to not blending the render textures. You can either use an older SFML build, or wait for the next version of the light system to come out (soon!).

Ah, thanks for the reply. I'll gladly wait it out and work on other aspects of my game in the meantime.

9
SFML projects / Re: SFML Light System - Let There Be Light
« on: April 08, 2012, 06:01:57 pm »
I'm having trouble getting the emissive light to work (light point is fine). The whole screen turns white when it renders.

10
SFML website / Re: New forum
« on: March 31, 2012, 10:42:27 am »
Is it possible to have links from the old forum redirect to the corresponding topic in the new forum? It's frustrating to run into posts that link to other topics, only to be thrown a page that says the forum has moved with no way to get to the actual topic.

Pages: [1]
anything