Me? Yes. But what I mean is, when I make a new class object and then call one of it's functions from a different scope from which the class was created, I get a compiler error.
He creates the object on the heap and stuffs it into an container; the container is accessible in the scope he's doing that loop to draw the objects.
[QUOTE=Xera;17065324]Nice GUI. Is the entire system your own?[/QUOTE]
Well yeah, no libraries or anything
[QUOTE=ZeekyHBomb;17065816]He creates the object on the heap and stuffs it into an container; the container is accessible in the scope he's doing that loop to draw the objects.[/QUOTE]
And is the container in this case a pointer?
No.
A container like std::vector.
How about a struct?
I'd love to write a GUI System, But I want to write a rendering system before that :p
Nice work Qurl
[QUOTE=Max of S2D;17064270]I just finished working on a video using new fancy pieces of software (the first time I actually use them):[/QUOTE]
Hi, how was your day following garry?
I really don't get you.
What's so hard to understand? The object sits on the heap, thus is not destroyed automatically (also the behavior of static variables; but whatever) and to use it in a wider scope he stores it in another object, which is in this or an even wider scope.
I have forgotten a ton of things :/. I'm rereading Pointers, classes, structs and vectors just now.
[QUOTE=Tezza1234;17066286]I'd love to write a GUI System, But I want to write a rendering system before that :p
Nice work Qurl[/QUOTE]
its fucking awesome when you get to the point where you can hook it up to shit to change shit around
[img]https://dl.getdropbox.com/u/99765/fgsdf34.png[/img]
Im working on a simple window thingie which you can drag around. (pics soon to be posted)
and a pit offtopic :
How would I make my renderwindow (sfml) accessible for all classes.
I pass a Reference In the constructer and hold a pointer locally.
[QUOTE=Tezza1234;17066537]I pass a Reference In the constructer and hold a pointer locally.[/QUOTE]
Care to explain a bit more ? (Pm ?)
[QUOTE=quincy18;17066514]How would I make my renderwindow (sfml) accessible for all classes.[/QUOTE]
That calls for a Singleton.
Google will surely tell you what it is and how to use it :)
Hah, everyone is going with the Derma style now.
[QUOTE=Overv;17066815]Hah, everyone is going with the Derma style now.[/QUOTE]
coz its a good placeholder, you can go into gmod and see how parts should behave
[QUOTE=quincy18;17066514]
How would I make my renderwindow (sfml) accessible for all classes.[/QUOTE]
Pass a reference of the renderwindow to the function you want to use it with. I've just done it like this:
[code]class ChestSprite
{
void draw( sf::RenderWindow& win )
{
win.Draw( Chest );
}
};[/code]
Then just call the function draw with a parameter of your window name:
[code]sf::RenderWindow App( Stuff );
ChestSprite Chest;
Chest.draw( App );
[/code]
How can I stop two ChestSprites from being created on pressing F2 in my earlier code?
On pressing F2 I get two of them:
[img]http://img90.imageshack.us/img90/880/capture2n.png[/img]
Can anyone rememebr the name of that library that was sort of a file system that allowed you to "mount" Zip files and such?
would be nice to see some more botch stuff
[QUOTE=Tezza1234;17067472]Can anyone rememebr the name of that library that was sort of a file system that allowed you to "mount" Zip files and such?[/QUOTE]
PhysFS?: [url]http://icculus.org/physfs/[/url]
[QUOTE=Fox32;17067593]PhysFS?: [url]http://icculus.org/physfs/[/url][/QUOTE]
That's the one, Thanks muchly!
[QUOTE=Overv;17066815]Hah, everyone is going with the Derma style now.[/QUOTE]
How is that 'dumb' and 'bad spelling'?
[QUOTE=Overv;17070912]How is that 'dumb' and 'bad spelling'?[/QUOTE]
coz people abuse ratings, should disable them.
[QUOTE=qurl;17063580]Well I'm making a UI lib that can just plug into any dx game, like source games, GTAIV, things like that.[/QUOTE]
Like [url=http://www.playxpert.com/web/guest/home]PlayXPert[/url]?
[QUOTE=Wickedgenius;17067437]
How can I stop two ChestSprites from being created on pressing F2 in my earlier code?
On pressing F2 I get two of them:
[img]http://img90.imageshack.us/img90/880/capture2n.png[/img][/QUOTE]
Are you creating the chests when the button is down? (Rather than when is changes state from up to down) because if you are then the code loop will be executing a few times while you think you have only pressed it quickly (to the PC you have held it down for several cycles) and thus it will be creating multiple instances.
[QUOTE=Overv;17070912]How is that 'dumb' and 'bad spelling'?[/QUOTE]
I love when people ask that stupid question.
Here's an example:
Ahem.. guys why re you rating me dumb!!??
o no some1 on tha internets r rating me
[B]edit:[/B]
huh!?!? y u r8 me bad m8s?!!
I love when people comment pointlessly about people wondering about their ratings.
My pet peeve is superior.
ppl that rate U dumb R just jealous.
Sorry, you need to Log In to post a reply to this thread.