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

Pages: [1]
1
General discussions / Re: A new logo for SFML
« on: April 20, 2013, 01:47:33 pm »
I just want it to look good :P

And no, no 3D... SFML is everything but 3D.
Well I suppose if I had to make a logo I would make it so that people associate it with the library. I mean, if it has to give a feeling of simplicity, perhaps all those shades and glow and I don't know how you call it should be evaded. The logos of Gtk+, Boost and Qt for example, look pretty but are still very simple. I'd suggest trying something like that. Also, is it needed that the name of the library is written on the logo? That makes it pretty big and it makes it harder to create small sizes of it, while still recognizing the letters, like the favicon of the site. What about "just" a nicely colored pentagon or some other shape?
I'm just throwing in some ideas, I'm not creative at all so please don't mind me if I say something stupid :)

EDIT: Or perhaps a shape with "sf" in it?

EDIT2 something like this? Very dirty quick sketch, svg available:

I found this post by Bigz, I think these are really good:
http://en.sfml-dev.org/forums/index.php?topic=4960.msg73799#msg73799

2
General discussions / Re: A new logo for SFML
« on: April 19, 2013, 06:22:49 pm »
What must be the impression of the logo? Do you want to accentuate on the simplicity, the 2d rendering, the 3d rendering or the audio? I think that if you want to focus on 2d, it's a nice idea to make the logo 2d as well. I think krzat's logo really stands for simplicity. If you want to focus on 3d perhaps it's a nice idea to make the logo with blender or something? I read some Gnome application icons are made with blender too. Not that I can, though, not that creative xD

3
Graphics / Re: Cant load font from terminal
« on: March 24, 2013, 01:27:55 pm »
You first need to cd into the directory in which the font file is, and then start the app. Just copying the full path of you executable won't change your working directory to the path of the executable.

4
General / Re: CodeBlocks 12.11 SFML 2.0
« on: March 03, 2013, 05:10:32 pm »
Just a long-shot: did you forget to include the Window module?
I had a problem like you today and I solved it like that.

I never had to include it before, I got this error since I updated my C::B and gcc.

5
Graphics / Re: Get the focus of a window
« on: November 13, 2012, 05:45:25 pm »
Ok, thanks!
I'm using XFCE 4.10, if you're interested.
I'll set this topic to solved, since I don't know if this is a bug or not.
Thanks again for the help.

6
Graphics / Re: Get the focus of a window
« on: November 12, 2012, 10:13:39 pm »
I get it, thanks.
I fixed the problem with a bool to keep track of the focus using the events.

It works pretty well, but when I try to move the window by the titlebar(drag the window), it takes this as a mousedown.
But my widgets aren't drawn on(under) the titlebar, so there's no way to actually "shoot" at the titlebar.
Is there a way for me to fix this too(while keeping the titlebar)? Is the size of the titlebar a part of the size of the window I give at creation?

7
Graphics / Re: Get the focus of a window
« on: November 10, 2012, 04:33:50 pm »
Thanks for your reply.

So if I keep my mouse down for 10 seconds, will the MouseButtonPressed event be given every loop in that 10 seconds?

8
Graphics / [Solved]Get the focus of a window
« on: November 10, 2012, 01:50:44 pm »
Hello all,

At the moment I'm trying to put everything I've learned in a small project, just a point and click game.
It's like duck hunt, a duck flies through the air and you have to "shoot" it by clicking on it.
Here's my problem:
Every loop (1/25sec) I check if the left mouse button is down and if the "cooldown" of the gun is passed.
If that's true I check if the duck is shot etc.
This all works fine.
But when I click outside of my window, my program takes that as a attempt to shoot the duck, this ruins my whole system because I want to keep track of the longest sequence of good shots etc.
What I'm trying to achieve is this:
if ((WindowIsFocussed) && (MouseButtonIsDown) && (CooldownPassed))
//Check if duck is shot etc.

So I'm searching for a function like bool sf::Window::isFocussed() or getFocus, whatever.

If I search for this function I find a request topic, so I guess the function is not yet implemented.

Is there any workaround for me to do this? I don't like to use the event system because I want to be able to just hold the mouse button.
I can think of using a bool to keep track of every time I get an LostFocus and GainedFocus event, but I was just wondering if there was a more neat way to achieve this.
I also thought of creating my own class derived from sf::RenderWindow, but after a look at the files my head hurt ;D

Thanks in advance!
Steef

9
Graphics / Re: Global sf::Renderwindow used in derived class
« on: November 05, 2012, 06:39:17 pm »
I'll try that, thanks again!

10
Graphics / Re: Global sf::Renderwindow used in derived class
« on: November 04, 2012, 09:49:19 pm »
Can you show a short code that shows the principles of your state-changing function? What state is that exactly?

And don't confuse global functions with global variables. The former are perfectly fine -- in fact, a member function is not much more than synctactic sugar for a global function that takes this as first parameter.
Well, it's not actually a state, but more like a switch between the main menu, the intro, the game itself etc.
I hope this makes it clear:
enum GameStates {
    STATE_NULL,
    STATE_MENU,
    STATE_GAME,
    STATE_EXIT
};

int next_state = STATE_NULL;
int stateID = STATE_NULL;
Gamestate* current_state;

void set_next_state(int newState)
{
    //at the end it could set next_state to a new value, for example STATE_MENU
}

int main()
{
   if (next_state != STATE_NULL)
   //set new state
   current_state->input;enum
   current_state->drawings;
}
There is also another function which actually creates and deletes the states, but I left it out for the sake of compaction. This function also needs the global variables, of course.
So if let's say STATE_INTRO ends, then the class of the intro will call set_next_state(STATE_MENU).

Thanks again!

11
Graphics / Re: Global sf::Renderwindow used in derived class
« on: November 04, 2012, 08:17:17 pm »
Yeah, I know global variables are all bad, but I thought throwing around references shouldn't be good either(your article doesn't agree ;D).
It did fix the problem to just add a reference to the class, however. Quite strange if you ask me.

You're right, and the constructor shouldn't be there either. I just wrote it out of the top of my head.

I also have another question, if the mod doesn't mind me :P.
In the tutorial I'm following(a bit) they use a global function(and two variables used by it) to change the states, since the current state should be able to do so too(setting that in the next main-loop the state will be changed).
Should I also avoid that, and if so, how should I?
I could create a Statemanager-class that gives each state he "owns" a reference to itself, but wouldn't that be messier/worse?

Thanks for the help!

12
Graphics / [solved]Global sf::Renderwindow used in derived class
« on: November 04, 2012, 05:11:10 pm »
Hello all,

Perhaps I better say this first: I'm not sure if this is a question related to sfml or if I'm just being stupid at C++.
I fear for the latter ;D

I'm using the latest snapshot built on Ubuntu 12.10, my compiler is gcc.

This is my problem:
I'm trying to learn about different techniques for state-changing(from intro to menu etc.).
The one I'm now trying to implement uses a base GameState class which will be derived by all the states(not exceptional).
So that class, which looks something like this:
class Gamestate
{
    GameState(){};
    virtual void logic() = 0;
    virtual void input() = 0;
    virtual void render() = 0;
}
I derive in my Intro class.
I have a global sf::RenderWindow* window which I use in my derived class.
My input()-function looks something like this:
void input()
{
    sf::Event event;
    while (window->pollEvent(event))
    {
         //process input...
    }
}
This all compiles fine but when I try to run this program it gives me a segmentation fault(core dumped).
I'm pretty sure it has nothing to do with my state-system, the debugger tells me the program gives the error after the first call to the RenderWindow out of my Intro-class, in the input function at the first line of pollEvent in Window.cpp.

Yes, I did initialize(is that the right word?) the RenderWindow, I did even call create() right after that just to be sure.

Again, I'm still quite new to C++ and sfml, so it could be something stupid I overlooked.

It would be very nice if someone could help me out with this, I'm already looking at this error for over an hour...

Regards,
Steef

Pages: [1]
anything