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

Pages: [1]
1
Window / Key combinations in SFML
« on: January 11, 2013, 02:52:56 pm »
Well, handling key combinations like when 'shift' and 'a' are held using real time input are easy peasy.
But I have a problem. I need combinations like "ctrl and left mouse button pressed at once". I can get mouse event at one loop and the ctrl event at the next loop. So it's hard to do. What's the good way of handling this?

2
Graphics / Rendering on minus coordinates in linux
« on: January 09, 2013, 02:13:51 pm »
I have a strange problem. After porting my game to linux and to newest SFML 2 snapshot, the strange bug appeard. When I draw textured sprite at for example (0, -5), it doesn't get drawn at all. On windows and sfml 2.0 rc, the sprite was drawn cutted at the top (which is what I need for smooth scrolling). Is there something different on linux/was something changed in sfml recently? Or it is a bug in my code and for you drawing on linux on minus coordinates works?

Nvm... It was caused because C++ is weird....

int a = 5
unsigned int b = 30;

a - b = 423121312313213213
 
So stupid, I need to cast unsigned to int every time I store something in unsigned (ie widget position).

3
Graphics / Render Texture and weak gpu
« on: December 26, 2012, 02:10:08 pm »
I know that if it comes to normal texture, on most intel gpus etc it can be only 512x512. My question is if render texture must be 512x512 too? If yes, is there any ready class that acts to me like one render texture and actually it cointains few smaller render textures?

I also want to know the same about normal textures if there is such a class that allows me to have 800x200 textures on all gpus and render it.

Thanks

4
Window / setPosition and getPosition don't work correctly on linux
« on: December 24, 2012, 03:32:54 pm »
So, I use lubuntu 12.10, the window manager is openbox. Code:



#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
 sf::RenderWindow window(sf::VideoMode(1400, 900), "Bug");
window.setPosition(sf::Vector2i(sf::VideoMode::getDesktopMode().width / 2 - window.getSize().x / 2, 80));
std::cout << window.getPosition().x; //gives 1
std::cout <<  window.getPosition().y; //gives 26

 while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

}
 

My resolution is 1920x1080, so it should be x = 260. Of course, the position isn't updated on screen as well.

5
Hi,
for example in browser when you resize the window the text is always the same size. In SFML, when I create 1200x900 window, the text is exactly as I want, but when I maximize the window, it is way too big. Is there any simple way to make the text always be the same size :)?

Thanks

6
Graphics / Creating windows using wxwidgets - anti aliasing and vsync
« on: December 18, 2012, 08:16:18 pm »
Hi, I will specify my problem. My app is written using SFMl gui, but I need native cross platform file chooser (and saver) dialog. So the only option is to use wxWidget's wxFileDialog. However, to call it I must have wxWindow. So I think that I will make the window using wx (to have the wxWindow object) and give the handle to RenderWindow and that RenderWindow will control the main loop and events. However I have a question - when I enable VSYNC using sfml will it work? And what's more iportant, will SFML anti aliasing work when the window is created by wxWidgets?

edit:
While not related to graphics module I'll also ask about it. Will I be able to get events through SFML when I construct render window that way (assuming I don't do event loop at wxwidgets level)?

Thanks

7
General / Integrating SFML and FLTK (or other widget lib)
« on: December 12, 2012, 06:30:32 pm »
I have an app written in FLTK 1.3 (http://www.fltk.org/). I want to create a big widget (something like subwindow), which will act like SFML render window and I will be able to render using SFML there. The problem is I want FLTK to handle main window, so there is a conflict.

Any tips or your experience with something similar?

Big thanks in advance!

8
General / Linux - complining only network module
« on: December 11, 2012, 12:28:14 pm »
I'm writing linux server. I use enet for reliable udp and I want to use sf::Packet for easy packet managment (and then send packets using enet, it works and its great). Now I have server on my home linux pc, so I have full sfml compiled here. However server will be on VPS, so my question is how to tweak cmake and what libs I need to just compile only network module on linux.

Thanks

9
Window / setKeyRepeatEnabled(false) and text entered event
« on: December 05, 2012, 05:31:55 pm »
Hey.

I'm designing a input high-level system for my game and I have a design problem. If i set setKeyRepeatEnabled(false), which I need for my input system, how will text entered event behave? I mean, if I hold "A", will i get "A" every some time like in text editor or will that function disable key enabling for text entered event too?
Of course I'm asking about text entered event, as obviously I know that it will disable repeating for key pressed event.

Thanks!

10
Graphics / [2.0] VSYNC bug on AMD cards
« on: November 04, 2012, 10:31:30 pm »
Hey I have a problem. When I use vsync in SFML window on amd hd 6870 i get 97-99% gpu usage @60 fps, and without vsync i have like 30% gpu usage @ 300 fps. The problem exist on both pre compiled sfml 2.0 version and latest git compiled few days ago. It happens on both newest drivers and those 1 year old. What's more, it happens both on windows 32 bit and linux 64 bit. Of course the problem only exist with SFML apps, in games like guild wars or any other when i enable vsync the gpu usage is low as it should be (you can check usage in ati catalyst control center/afterburner/gpu-z).

IMPORTANT THING: When I used nvidia gts 450 gpu I didn't have any problem at all (I mean, with vsync enabled in that 2d sfml application gpu usage was about 15%). 

So here's the code that is enough to make it happen:
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "VSYNC AMD BUG");
    window.setVerticalSyncEnabled(true);
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.display();
    }

    return 0;
}
 

And thats enough. At first i thought it was something with my drawing code, but the bug exist even on empty window with vsync. When you compile it without vsync, gpu usage is 30%. Enable vsync and boom 99% is used all the time.

And please remember, this is only amd related bug (well, hd 6xxx for sure, i don't know about others) and I think this bug may be crucial as enabling vsync in small 2d game causes powerful gpu to run into high temps (and despite visual advantages of vsync, the another purpose is just to reduce fps = reduce gpu usage = reduce temps and power consumption and the problem is that using sfml's vsync on amd card does exactly the opposite, because without vsync the gpu usage is 3x lower than with vsync enabled).

What's more, when I once run pure opengl app with vsync on my amd 6870, gpu usage was about 35% I think, so it may be something related to how SFML implements OpenGL vsync. It also probably is in some way related to amd catalyst drivers (as SFML vsync works as it should on nvidia cards), but as I said i seen opengl application with vsync where the problem wasn't present on amd card, so maybe there is another possible way of implementating vsync in opengl that will work flawlessy on both amd and nvidia.

Thanks for help!

Pages: [1]
anything