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

Pages: 1 2 3 [4] 5
46
True...  Hrm. Still never quite get the whole private thing though. I guess in the case of libraries people make such as SFML it makes ie easier to use.

Ah. Is there an advantage to using one over the other?

For normal variables, I know that imiplicit assignment variable(value) is the same as variable = value, but in the case of an object, the only thing that A object(value) would do is prvide the value to a parimatarized constructor. As such, I am unaware what using = would do, not to mention if it does provide to the constructor, I am pretty sure there is not a parameter taking one that I know of.

47
Are you saying that if you assign one object the value of another object, any, say, common variables, such as the non static constant time one, is assigned to the object beign assigned to, similar to using time.variable = time.variable?

Ah. right. I get those mixed up, but I remember it had an m in it. Although, I only saw it in the time.hpp (speaking of which, what is an hpp? A C++ header file that isn't .h for some reason?), not the doc. Why?

48
Ah. I guess that answers that.

the only time I have come across the term recursive is functions calling themselves, say. I have no idea how that goes with classes so much, and what = has to do with it.

m_milliseconds, the private member?

I guess that would make sense. I still don't get the = part though. The tuturials I had never said anything about an object = anything, so I don't know what it does. Does it... do something?

49
Sub Directory. Like, a folder further in the path?

Let's say my .exe is as C:\Folder1\. Could the DLL's still work correctly in C:\Folder1\Folder2\ ?

I agree. I really m a bit befuddled, though. Time is a class. You make an object of that clase, time. It has some sort of constructer, all its members, etc. The function getElaspedTime() returns a Time object. I don't recall anything about making an object equal another object. The only thought that comes to mind is your overloaded the = operator, but in the doc, unless I missed it somehow, you overloaded every operator BUT =. Well, and [] and ., I guess. And... ->. I think.

I am officially confused.

Of note is that its public member attribute is static... but it is also constant, which, for me at least, suggest it cannot change, except upon creation, but it must incriment somehow...

Am I dumb or is this more complex? :)

EDIT: On second though, I got the clock and Time mixed up. The clock incriments itself. Now... I find this very confusing :) hopefully it grows on me. I tried:

#include <SFML/system.hpp>

int main()
{
    sf::Clock clock;
    while (1)
    {
        if (clock.getElapsedTime().asSeconds() > 5)
        {
            break;
        }
    }
}
 

Is this more of the correct way? It is hard to tell because with GUI project the debugger defaulty pauses at the end.

50
I am not saying they do not use DLL's, I am saying I never SEE them. Out of sight, out of mind.

Indeed. Something occurs to me now... asSeconds does not take an argument, does it? That explains a few things. In this case, the latter one makes sense - your time is equal to the time object it makes, in seconds, sort of. The first one confuses me, though. How can you assign one object (Time time) to another time object? Throws me a bit.

51
Well, currently, if I have any project working, it is a.exe with a bunch of DLL's next to it. Let's take most games you would download today. I don't recall ever seeing a DLL, and things are neatly inf olders. I think. Hrm. Although most of those had installers.

I was actually planning on getting better on that once I get SFML working. Not to mention, at my level I don't think I quite need virtual functions and the like yet.

On OO, I get classes - useful - and inheritance also makes sense. What I don't like as much is the public and private stuff. Like... the only way a memeber you migh tmake private would be changed is if you did something with it... never quite understodd that. I also don't quite understand how inheritance and how you inherit (Public, Private, Protected) work in regards to each other. Similarely, I don't entirely get the idea of a friend function. I guess looking back at tuturials would be a good idea, though. Got to learn it sometime.

As per the clock - to be honest, I have never seen a function that returns an object. Would you need to assign a pointer to this object or something? Still confuses me. In my mind, to use it you need to have a variable to refer to it, whcih means you must assign something to it. The only assignment I can think of is a pointer.

As per understanding the tools... I don't really know how to learn that part all that much.

52
Ouch. My self esteem is dropping :)

Well, from what I can see, it returns a time value. Or... would that be an object, I think? I wasn't entirely sure how to use said object. Or, what variable to apply toSeconds to, and I was a bit confused by what memebers held the time data and how it could be used. I will look into it agaian and see if I can figure it out this time. Although the first few times I tried Iwas trying to get a float. I forgot that was SFML 1.6.

Ah. That is logical. From.. at least this and another set of external libraries I have tried, there the DLLs, the static libraries, and debug versions of each, but I never quite knew the difference.

On the DLL's... path. That term always scares me. I feel like if I tried to get it working,  - well, it wouldn't work. Sigh. Still not entirely sure what this is, either. Something involved with running something from the command line, though. Or, perhaps, compiling it from there. What I mean is, though, is there a way I could package the app and libraries but not have them all in one single folder together? Seems... odd for whatever reason.

I agree that I am not very expierienced in this area, but I do know a bit about how it works. Compilers turn the source files, let's say, into object files (I think that is .o?) The linker puts them together into an exutable. I don't know much about runtime compared to this but if I recall this is where libraries come into the mix.

Probably not a bad idea to read into it more, though.

On that note, seeing as how I am not very expierienced, where do you recommend I start? I am guessing you have a good idea of what is good to learn, and if you find it beneficial it probably is a good idea. It would be nice to know how to... well, how everything works - an dnot just how everything is seemingly handled with whatever the IDE does. Currently, though, I was just trying to see if I could make games, using C++ instead of a game engine. Throughout this process, this has been my main goal. Looking at the SFML projects sections, it seems many people share thiis interest. I don't know what other background learning one would really have on how everything works, but I am all ears if you have suggestions.

53
I understand. Sorry, I guess I just get frustrated a bit easily with these things.

I will try that, yes. Turns out, I did read it wrong - I wasn't exactly looking to see if it was display or Display, I was looking to see if it was or wasn't there altogether.

I don't think I have gotten any errors, yet, beyond those of incorecctly using SFML. That reminds me. Recall that "press up to close" theory I have? When run, it opens neither the console (as it is a GUI) or a window. PRessing up only does stuff with the Code::Blocks window. Is this because it was not in focus and cannot use the input?

Other than this, the clock confuses me. If I followed the doc correctly, (and degub error messages) the Clcok member getElapsedTime() returns a Time value. Time objects have a function inSeconds (I think), but using it did not seem to work. (as in, mytime.inSeconds(myclock.getElapsedTime). Either way, I am not entirely sure how to get the time at all. I feel it is more simple though. What am I missing?

I also wonder about DLL's. The only way I have gotten things to work, such as the pong example, was to place all the DLL's, say, literally right next to to it. Is there anyway it could be all in a folder somehow? Instead of all the DLL's you use.

Also, what is the difference between debug libs and.. non debug ones?

54
The doc that comes with it. The HTML help file. It had it as Display, I thought. Mabye I misread it, because display() works.

I just wanted to start learning, eh, how to use it. I was also pretty certain that clock returned a flaot but it seemes it returns a time which then has a function for a flaot. Kind of confused...

Any idea how long itll tuturials are up?

55
So I figured. But I am not sure where to find examples, or on the forums to much, (not a simple test anyhow), and qouting the doc that came with the release canidate:

void sf::Window::display  (  ) 

Display on screen what has been rendered to the window so far.

This function is typically called after all OpenGL rendering has been done for the current frame, in order to show it on screen.


I don't know how display would not be a member, unless the doc has not been updated or something.

For some reason I cannot get the clock to work... I thought it returned a flaot but ti seems to return a time.. hrm.

What is an example code I COULD test?

56
Ah... I had lsfml-xxx, not -lsfml-xxx. Quite sorry.

Those errors are gone. I really want to see something, eh, work. So, I thought, I can try the window example code.

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>


////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");

    // Start main loop
    bool Running = true;
    while (Running)
    {
        App.Display();
    }

    return EXIT_SUCCESS;
}
 

The error is that Display is not a member of the Window class, of which the object App i s. However, in the help manual, (for this rc anyhow), display is listed as a member. Or, trying the random number generation example, randomizer seems to not exists.

Are these errors caused my changed names/classes or am I still doing it wrong?

THanks.

57
Lightning fast reply :)

I made a typi t seems. I said I did both the lib and include folders for compilers. I got the include folder for the compiler and the lib folder for the linker.

This occured to me. I tried testing it with -lsfml-xxx, etc, and I get the exact same error, except it says it with the l, etc. "lsfml-system: no such..." etc.

Speaking of using the normal inclusion of libraries, would you just include them, in order, as the DLL's or in the case of static, the static libraries?

58
Ah. Yes. I see that, and am using it now. Here is what I did.

I made a new, empty project.
I went to PRoject Properties, and made it into a GUI application (for both debug and release for that project)
I went to Project Build Options
    I went to search directories, and got the sfml include folder for compiler
    I went to search directories, and got the sfml lib folder for compiler
    I went to linker options, then other linker options, and added in this order:
-sfml-graphics
-sfml-window
-sfml-system

I used a small code concocted with some help from the HTML doc, it was like so:

#include <SFML/system.hpp>
#include <SFML/window.hpp>

int main()
{
while (!(sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
{
//hrm
}
}

In theory, when you press up, it will close, right? I don't recall if it was isKeyPressed or getKeyPressed.. I made it using the help doc and it threw no errors once I got it right. This was off the top of my head though.

The error I get is from g++: -sfml-(whatever_module): no such file or directory.

This occurs for all three files listed in the other linker options. Ideas?

59
The 2 binaries are coming out in a few days?

Have you heard og Game Maker? Mabye you have. As with most games engines, it is more user friendly. IT has (at least, the way I used it), a stripped down and very friendly version of C/C++, sort of.

It is useful because it is easy to make things, such as how it goes with "rooms" sort of like D&D level design. However, in the same way that it is useful, the same friendliness also restricts it a bit, and I want to try to make it... well, this way.

So, in my adventures, I found Code::Blocks. And, seeing as I didn't really know a thing about compilers or linkers at the time (still pretty true), I am using MinGW.

I, following tuturials, began learning C++ using the compiler. Worked, more or less. LEarned... most things. Practice will help though. However, it struck me that, you cannot really make games all that well on the console alone with no external libraries - not that I know of anyhow.

So, I tried SDL, Allegro, and now this. I seemed to be cursed in that not a single one worked for me for whatever reason. I assume it is my fault somehow but at the same time I seemed to have followed the directions.

Seeing as how SFML 1.6 seemed to sort of work but not.. work at the same time, and do to some recommendations, I think I will try SFML 2, provided I can find a build of it. MY main hope is that I can at least try to make thing using the functions, and it, eh, works.

On that note, I am a bit confused. I feel like I like the idea of a static linking where you only hae on e exutable, but it occurs to me to load images, sounds, etc you will need to send other stuff with it as well, and thus... sigh. I am just a bit confused and frustrated.

Think we can ever make it work? :) (for me)

60
Origionally, I did install Code::Blocks with the MinGw with it, but the tuturial article suggested whatever other version.

It has ben suggested to me that I should try version two instead. Why did it go from 1.6 to 2.0, anyhow? Hrm. Although, the process of building it looks complex so I may search around for a place where somebody already made the binaries.

After that, though, I have the same problems...

I can set it so the linker/compiler can find it, (/include, /lib). I can put the libraries I am using in the exutables directory (for me, this seems to be just the same folder it is in - can this be made easier somehow?). In other linker options, I added, say, system, as -lsfml-system. I made an empy project. Testing any code from SFML, it... does not always throw errors, but it does nothing either - just a console window popup. This was true even for the window example when had a while loop.

On another note, when I was using static, I seemed to get more errors for whatever reason - fatal errors. Not sure why. Some of htem were things regarding WinMain16, which is odd because I had a main(). Or, int main(), to be precise.

Pages: 1 2 3 [4] 5