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

Pages: [1]
SFML projects / cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« on: September 05, 2009, 04:43:57 am »
I might adopt this project, as i need a GUI toolkit for my project, and using this would be easier than creating my own. However, i might have to release it under a GPL license, since my already existing window code is GPL license. Also, why did you put it all in one file? Doesn't that make it a pain to work with? (or do you have multiple files, you just combined them into one for release?). If you have it broken down into multiple files, i would appreciate if you PMed me the files or posted them here.

Really great! The biggest improvements i could imagine on this are the adding of "hot" colors as imgui called them, or mouseover colors, and the ability to have dragable windows with controls in them.

Window / Possible to embed a rendering window inside a window
« on: August 26, 2009, 04:46:04 am »
You would want to use something like wxWidgets to make the window and the controls on the left, then integrate that with a SFML OpenGL rendering on the right. You can read the tutorial on how to do with with wxWidgets, you can use other GUI libraries as well.

Graphics / Wierd "Blurring" with SFML.
« on: June 13, 2009, 04:18:29 am »
Here is some example code that reproduces the problem (for me). The problem seems to get much worse with smaller fonts (and large fonts actually look ok).

What are opengl hints, and how can i disable them?

Could is be that my graphics card has bad anti aliasing? (is this handled directly by the graphics card these days?)

Thank you for your interest in helping me!
Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>
#include <string>

int main() {
    sf::String ExampleText("||||||||||||||||||||||||||||||||||||||||||||\n"
                           "The quick brown fox jumped over the lazy dog");
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Example");
    bool Running = true;
    while (Running) {
        sf::Event Event;
        while (App.GetEvent(Event)) {
            if (Event.Type == sf::Event::Resized) {
                sf::View View;
                View = App.GetView();
                View.SetHalfSize(Event.Size.Width/2, Event.Size.Height/2);
                View.SetCenter(Event.Size.Width/2, Event.Size.Height/2);
                std::cout << "Width: " << Event.Size.Width << "\tHeight: " << Event.Size.Height << '\n';
            } else if (Event.Type == sf::Event::Closed) {
                Running = false;

Graphics / Wierd "Blurring" with SFML.
« on: June 11, 2009, 02:34:28 am »
Well, as far as i know, i am using a view equal to the size of the window. Here is my code that handles the sf::Resized event:
Code: [Select]
if (Event.Type == sf::Event::Resized) {
    // Resize the game view
    // Resize and center the "Normal" view (toolbars and menus are drawn on this one, including the toolbar that has the problem images/text drawn on it)
    Gfx::NormalView.SetHalfSize(Event.Size.Width/2, (Event.Size.Height)/2);
    Gfx::NormalView.SetCenter(Event.Size.Width/2, (Event.Size.Height)/2);
    // Resize the menu at the bottom

Is there some other was i should be doing it to make the width/height as it should be? I really like SFML (It's fast and really quite nice to use :P), but i hate this problem, and i hope there is a way to fix it.

Graphics / Wierd "Blurring" with SFML.
« on: June 09, 2009, 07:16:07 pm »
Well, i turned of the smoothing for the icons (i don't want smoothing anyway, since they won't be resized), but is there a similar option for text?

Is what i get for output when i display a series of pipe characters (|) on the screen. I would like to disable any blurring of the font, especially if it is uneven like in the picture. Is there any way to do this?

Graphics / Wierd "Blurring" with SFML.
« on: June 07, 2009, 03:14:24 am »
That fixes it... why was the "smoothing" making it look really bad?
I've disabled smoothing for now, because it makes the images look really bad, but is there any way to disable smoothing only if the image is at it's regular size? (so that images are smoothed when drawn at smaller and larger sizes than normal, but not otherwise)

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?

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:
-------------- 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);

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:

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

Pages: [1]