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

Pages: [1]
1
Graphics / Wierd "Blurring" with SFML.
« on: June 07, 2009, 01:25:12 am »
When i try to display images to the screen on my "Menubar" at the bottom of the screen, they end up very garbled and messy looking.

The image on the left is what comes out when i display it onscreen, the image on the right is what *should* come out. (it is a "X" with a transparent background and a black border. The transparency has been replaced with the menu color for the purposes of this post). Note that the image has been scaled to 8x so that you can see what is happening easier.

Any idea why this is happening? If you want to take a look at the code, you can get it from the "opentower" sourceforge project (there is way too much to post here, although the relevant code would all be in /game). I'm guessing it's something to do with the view being set weirdly?

2
General / Trying to get SFML (1.4) to work
« on: May 18, 2009, 06:29:26 am »
When i attempt to create a sprite in my program, i get a linker error:
Quote
-------------- Build: Debug in OpenTower ---------------

Compiling: Main.cpp
Linking console executable: bin\Debug\OpenTower.exe
Info: resolving vtable for sf::Spriteby linking to __imp___ZTVN2sf6SpriteE (auto-import)
obj\Debug\Main.o(.text$_ZN2sf6SpriteD1Ev[sf::Sprite::~Sprite()]+0x3a): In function `ZNSt8_Rb_treeIPN2sf11ResourcePtrINS0_5ImageEEES4_St9_IdentityIS4_ESt4lessIS4_ESaIS4_EE11_M_put_nodeEPSt13_Rb_tree_nodeIS4_E':
G:/PortableApps/mingwportable/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_construct.h: variable 'vtable for sf::Sprite' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 5 seconds)
0 errors, 0 warnings

Sorry if i missed something obvious, i tried to look up the documentation for --enable-auto-import, but was unable to find it :/

The code i use to get this error is:
Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>

int main() {
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "OpenTower");
    sf::Image GroundImage, SkyImage;
    system("echo %cd%");
    if (!GroundImage.LoadFromFile("images\\Ground.png") ||
        !SkyImage.LoadFromFile("images\\Sky.png")) {
            std::cout << "Error Loading Images!";
            return EXIT_FAILURE;
        }
    system("echo %cd%");
    sf::Sprite Sky(SkyImage);
    //sf::Sprite Ground(GroundImage);
    //App.Draw(Sky);
    //App.Draw(Ground);
    system("PAUSE");
}


and i link the following libraries, in order:
- libsfml-graphics.a
- libsfml-main.a
- libsfml-window.a
- libsfml-system.a
(note that i have tried changing the order of these to the reverse, with no effect)

I also pass the following parameters to the linker:
-lsfml-graphics
-lsfml-window
-lsfml-system

I am using Code::Blocks and mingw on windows xp professional. Any help (or pointing out my obvious error) would be appreciated :).

Pages: [1]