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

Pages: 1 ... 85 86 [87] 88 89
1291
General / Compiz Fusion is bugging me...
« on: April 06, 2009, 10:52:37 pm »
I have an integrated Intel too. Don't know the exact model though. It could be that. Intel is known to NOT be good with OpenGL.

1292
General / Signalsending system
« on: April 06, 2009, 10:50:26 pm »
Oi! I'm making my own system for SFML. I've run into some problems and would like some help on it.

Anyway here's the basic how it works. We have a 3 Base objects. SignalSender, SignalReciver, SignalBase. SignalBase represents a signal which is sent by SignalSender to a SignalReciver. And the SignalReciver can subscribe to different levels of signals. Every signal is associated with a string name. For instance QuitSignal's name is "Signal.Window.Quit" and represents a Closed event. A Receiver can subscribe to "Signal.Window" to receive all Window associated events. Or he can be precise and say that he only wants "Signal.Window.Quit" or he can subscribe to "Signal" to get all signals. The biggest point with the system is that the developer can create his/her own signal classes.

See it as a extension to the already in place system.

Anyway here's problem number one. Data... Data data data. Since I store all events in a std::queue<SignalBase> some data seems to be lost when I pump the extended SignalBase class in there. (Like MouseMovedSignal). I guess it's because the queue only copies the SignalBase part of the entire object?

Here's some code:
Code: [Select]

class SignalSender {
    private:
        std::multimap<std::string, SignalReciver *> subscribers;
        std::queue<SignalBase> signalQueue;

    protected:
        void SendToObjects(const SignalBase& signal, const std::string& currentNamespace);
        SignalBase ConvertSFMLToSignal(const sf::Event& event, sf::Window * window);

    public:
        SignalSender();

        void SubscribeReciver(SignalReciver * reciver, const std::string& type);
        void SubscribeReciver(SignalReciver * reciver, const SignalBase& type);
        bool IsReciverSubscribed(SignalReciver * reciver, const std::string& type);

        void AddSignal(const SignalBase& signal);
        void SendSignals();
        void FetchEventsFromWindow(sf::Window * window);

};

void SignalSender::AddSignal(const SignalBase& signal) {
    this->signalQueue.push(signal);
}



I was thinking of like, adding like some resource object in the SignalBase where we stuff in all signal specific data though I'm wondering if there's a more gracious method to do it. Also, is there some class I can use in the stl already?

Thx for the help on before hand


PS: Oh yeah Laurent, I fixed so it can calculate relative movement for ya now in multiple windows :D

1293
Window / MouseWheelEvent - How do you use it?
« on: April 06, 2009, 02:07:10 pm »
Aight I was right. I tested it and negative is down and positive is up.

1294
Window / MouseWheelEvent - How do you use it?
« on: April 06, 2009, 01:15:02 am »
I'm just wondering how you use MouseWheelEvent? It's the event to use when the event type is MouseWheelMoved right?

Is it that negative is scrolling downwards and positive is upwards? Is it relative? So the more scroll the higher/lower number?

1295
Graphics / sf::Image complains about "pure virtual function call&a
« on: March 03, 2009, 10:40:28 am »
Quote from: "Laurent"
Quote from: "Wizzard"
It seems as if the destructor of your image is being called after the OpenGL context has been deleted.

Make sure your sf::Image instance does not exceed the lifetime of your sf::RenderWindow instance.

This shouldn't be a problem with SFML, the lifetime of resources is not tied to the window, even if they depend on an OpenGL context.


Yeah seems like that, since it works in Linux.
Could be that it's just my Vista being strange. Hmppf... Unix is da zhizzle

1296
General / Compiz Fusion is bugging me...
« on: March 01, 2009, 05:51:24 pm »
Depends what program it is. Cairo-dock works perfectly. Though the SDL/OpenGL game Toribash workes somewhat. You can see the border and window easily. Though there are some visual conflicts in the rendering. Boxes appear and disappear showing the content behind.

Though a workaround is to have the window in Fullscreen, that seemed to work with no visual bugs. Well it will be up to the end user to disable Compiz I guess. Though I don't understand why OpenGL contexts conflicts so much with each other?

1297
General / When will SFML be updated to 1.4+ on Ubuntu Linux ??
« on: March 01, 2009, 03:47:35 pm »
I'm using Ubuntu 9.04 working perfectly and using the SFML 1.4 library.

1298
General / Compiz Fusion is bugging me...
« on: March 01, 2009, 03:43:33 pm »
Compiz Fusion in Linux adds some effects to my desktop using OpenGL.... And as SFML uses OpenGL as a backend, it conflicts with each others. When I open a window while hacing Compiz enabled, the window get screwed over and I can't even see the window border.

I'm wondering if anyone knows a work around for this?

1299
Graphics / sf::Image complains about "pure virtual function call&a
« on: March 01, 2009, 03:24:26 pm »
The image is correct and it finds it and it can set it to a sprite and draws it correctly. Everything works perfectly until it comes to the sf::Image::~Image() or whatever, when it destroys the image.

I'm using Codeblocks, I'm in Linux right now and about to try out the exact same source code and see what happens.

** UPDATE **
I tried it on linux and no error whatsoever appeared.
Everything worked perfectly. So it's a Windows/Vista specific error. I have tried to reinstall it with no success.

1300
Window / Is there a GetError() in sfml?
« on: February 28, 2009, 03:47:03 pm »
Most programmers want things virtual in C++, kinda like aiming against what Objective-C or Ruby or any dynamic language provides. The whole function lookup process makes it slower. While when you stay with the original C version, it just binds the function to the symbol compiled in the executable.

And sure I agree Globals are bad, but they are very usable, and if used you should only have it as some internal things for a set of functions.



I think we've strayed off-topic.

1301
Graphics / sf::Image complains about "pure virtual function call&a
« on: February 28, 2009, 03:41:46 pm »
Code: [Select]

sf::Image img;
img.LoadFromFile("image.png");


I know it's weird, it worked before, but suddenly yesterday it stopped working???
Though my vista has been acting weird lately... gonna try out the same code in Linux soon.

1302
Window / Is there a GetError() in sfml?
« on: February 28, 2009, 01:04:20 pm »
I would instead keep global variables in a namespace, you know like for things that don't need to be objects.

Like an ImageManager, though it needs two dynamic arrays to keep track of image and the name of image. Those I would keep global but only the functions within the namespace would be allowed to use them.

Like I have a "private" function in the namespace called "AllocData" that is not declared in the header file and it allocates the arrays. And thne the only function used outside is "sf::Image * GetImage(const char * name)". If your not going to use global here, would you instead place them in the GetImage function as a static variable?

I would say global variables is just a taboo by teachers and books. It's still Not everything needs to be objects, it only makes the application slower, so if it can be designed as not an object would be faster and better.

1303
Graphics / sf::Image complains about "pure virtual function call&a
« on: February 27, 2009, 09:54:59 pm »
Yo! While trying some stuff on Vista I get this error when exiting the application (When the sf::Image object is being destroyed)

Quote from: "Vista"
Runtime Error!

Program: {Path to application}

R6025
 - pure virtual function call


Return value of this is 255 (0xFF).
I've tried to isolate a special case though I'm not sure but I think it is when I don't use the image and just create it. But then if I have two images, each with an own sprite and then draw them, the exact same error is back.

** UPDATE **
This only happens when I load the image data from a file. Gonna try what happens if I change file and fileformat.

** UPDATE **
I tried changing file and format, no change in behaviour.

** UPDATE **
Only happens after I have loaded the image from a file.

1304
General discussions / SFML 2.0
« on: January 29, 2009, 08:46:13 pm »
Quote from: "Laurent"
Can't you just use a sprite with different scale?


Yeah I thought so too.

1305
General discussions / SFML 2.0
« on: January 29, 2009, 08:37:21 pm »
Quote from: "Wavesonics"
How about image resizing? That would be really helpful to me :p


Err, might be that I'm new, but isn't that already possible by using the scale functions?

**EDIT**
Aah sorry, that's just sprites. Though you can probably still do it very low-level like yourself with the Image ptr.

Pages: 1 ... 85 86 [87] 88 89