[img]http://filesmelt.com/dl/Pyhtagoras_Tree.png[/img]
[B]What is that?[/B]
[url]http://en.wikipedia.org/wiki/Pythagoras_tree[/url]
[B]Download:[/B]
[url]http://filesmelt.com/dl/Pythagoras_Tree.rar[/url]
I slaved over the weekend on a report stylesheet for LaTeX in Plain Old TeX just for the experience of building numbering'n'lists'n'friends from scratch, if that counts.
[img]http://www.cubeupload.com/files/89ae00untitled.png[/img]
Referencing is still stubbed out.
In C++, how do I convert a int into a string? I tried googling it but everything I tried didn't work.
[QUOTE=iPope;20345867]In C++, how do I convert a int into a string? I tried googling it but everything I tried didn't work.[/QUOTE]
[code]std::string itos ( int i )
{
std::string s;
std::stringstream out;
out << i;
s = out.str();
return s;
}[/code]
[QUOTE=Sasupoika;20345909][code]std::string itos ( int i )
{
std::string s;
std::stringstream out;
out << i;
s = out.str();
return s;
}[/code][/QUOTE]
That's a little verbose, though.
[cpp]
std::string itos(int i)
{
std::stringstream out;
out << i;
return out.str();
}[/cpp]
I'll try that again but last time I uses string streams it kept giving me unresolved externals.
A templated function is good here - since you can throw any variable type at it.
[cpp] template <typename T>
BString ToString( T var )
{
std::ostringstream os;
os << var;
return os.str();
}[/cpp]
(BString is a std::string)
Might as well fully template it and end up with boost::lexical_cast :lol:
[cpp]
template <typename OUT, typename IN>
OUT lexical_cast(const IN &in)
{
std::stringstream ss;
OUT out;
if (!(ss << in) || !(ss >> out)) throw std::exception("bad lexical_cast");
return out;
}
[/cpp]
AFAIK, that's pretty much the exact implementation of boost::lexical_cast.
Better doing that than including boost lexical cast and then having that include 20 more files and then slowing your compile time :)
[QUOTE=efeX;20347248]Better doing that than including boost lexical cast and then having that include 20 more files and then slowing your compile time :)[/QUOTE]
The boost headers do include tons of other headers, but I've never quite noticed this horrible compilation slowdown that everyone always likes to point out.
[QUOTE=DrLuke;20343643][img_thumb]http://filesmelt.com/dl/Pyhtagoras_Tree.png[/img_thumb]
[B]What is that?[/B]
[url]http://en.wikipedia.org/wiki/Pythagoras_tree[/url]
[B]Download:[/B]
[url]http://filesmelt.com/dl/Pythagoras_Tree.rar[/url][/QUOTE]
Is there supposed to be sound? I thought OpenAl was a sound library.
[QUOTE=nullsquared;20348108]The boost headers do include tons of other headers, but I've never quite noticed this horrible compilation slowdown that everyone always likes to point out.[/QUOTE]
Because there is none, really. People just like to bitch at boost because it makes your life 100 times easier.
[QUOTE=efeX;20347248]Better doing that than including boost lexical cast and then having that include 20 more files and then slowing your compile time :)[/QUOTE]
Which, most of the time, won't matter because you'll be using other parts of boost too and those files will already have been included.
[QUOTE=ryandaniels;20349143]Is there supposed to be sound? I thought OpenAl was a sound library.[/QUOTE]
Uhm, no, I just copied in all dlls that came with the exe, so there won't be any problems. I'm really an amateur, I don't know what most of the dlls are good for...
By the way, the engine is called Löve [url]http://love2d.org[/url] .
Yesterday (or the day before) I added a simple animation system to GWEN. Just simple resizing right now. You can see them in the video in the editor entrance (obviously) and in the chat.
The chat panel is so simple. It's basically a base panel, layed out on the left of the screen. When it gets chat it creates a RichLabel (a label which can have multiple colours) and puts it in the box, docked to the bottom. It then sets 2 animations..
[cpp] virtual void AddChatText( const WString& strName, Gwen::Color colA, const WString& strText, Gwen::Color colB )
{
Gwen::Controls::RichLabel* lbl = new Gwen::Controls::RichLabel( m_pContainer );
// NAME:
lbl->AddText( strName, colA, &m_ChatFont );
// : TEXT
lbl->AddText( strText, colB, &m_ChatFont );
lbl->Dock( Gwen::Pos::Bottom );
lbl->SendToBack();
lbl->SetMouseInputEnabled( false );
lbl->Anim_HeightOut( 0.5f, true, 8.0f, 2.0f );
Gwen::Anim::Add( lbl, new Gwen::Anim::Tools::Remove( 8.5f ) );
}[/cpp]
Which obviously makes the richlabel slide out and then get deleted. Easy! It sends them to the back, so when they're docked they appear on the bottom - not the top.
This video also shows the menu system. Which isn't very good looking, or particularly useful to us right now - but it works perfectly.
[hd]http://www.youtube.com/watch?v=XMlE_NExQ2o[/hd]
[QUOTE=garry;20350374]Yesterday (or the day before) I added a simple animation system to GWEN. Just simple resizing right now. You can see them in the video in the editor entrance (obviously) and in the chat.
The chat panel is so simple. It's basically a base panel, layed out on the left of the screen. When it gets chat it creates a RichLabel (a label which can have multiple colours) and puts it in the box, docked to the bottom. It then sets 2 animations..
*code
Which obviously makes the richlabel slide out and then get deleted. Easy! It sends them to the back, so when they're docked they appear on the bottom - not the top.
This video also shows the menu system. Which isn't very good looking, or particularly useful to us right now - but it works perfectly.
*video*[/QUOTE]
Nice, it looks very sleek.
[QUOTE=garry;20350374][hd]http://www.youtube.com/watch?v=XMlE_NExQ2o[/hd][/QUOTE]
Very VERY cool.
yay it works1
[QUOTE=DrLuke;20352242]yay it works1[/QUOTE]
Articulate.
Don't change your avatar like that man, I get all confused.
[QUOTE=garry;20350374]Yesterday (or the day before) I added a simple animation system to GWEN. Just simple resizing right now. You can see them in the video in the editor entrance (obviously) and in the chat.
The chat panel is so simple. It's basically a base panel, layed out on the left of the screen. When it gets chat it creates a RichLabel (a label which can have multiple colours) and puts it in the box, docked to the bottom. It then sets 2 animations..
[cpp] virtual void AddChatText( const WString& strName, Gwen::Color colA, const WString& strText, Gwen::Color colB )
{
Gwen::Controls::RichLabel* lbl = new Gwen::Controls::RichLabel( m_pContainer );
// NAME:
lbl->AddText( strName, colA, &m_ChatFont );
// : TEXT
lbl->AddText( strText, colB, &m_ChatFont );
lbl->Dock( Gwen::Pos::Bottom );
lbl->SendToBack();
lbl->SetMouseInputEnabled( false );
lbl->Anim_HeightOut( 0.5f, true, 8.0f, 2.0f );
Gwen::Anim::Add( lbl, new Gwen::Anim::Tools::Remove( 8.5f ) );
}[/cpp]
Which obviously makes the richlabel slide out and then get deleted. Easy! It sends them to the back, so when they're docked they appear on the bottom - not the top.
This video also shows the menu system. Which isn't very good looking, or particularly useful to us right now - but it works perfectly.
[hd]http://www.youtube.com/watch?v=XMlE_NExQ2o[/hd][/QUOTE]
Beautiful animations and interface!
Only a few posts left until v8!
I love that drink
Can someone help me or give me some psuedo-code on how you would do a "chat box" where as you add a line and you have a container of lines, but the latest line pushes the oldest line up and so on.
[QUOTE=efeX;20359819]Can someone help me or give me some psuedo-code on how you would do a "chat box" where as you add a line and you have a container of lines, but the latest line pushes the oldest line up and so on.[/QUOTE]
[cpp]
std::list<std::string> chat;
void say(const std::string &str)
{
chat.push_back(str);
if (chat.size() > MAX_LINES)
chat.pop_front();
}
drawStrings(chat, ALIGN_BOTTOM);
// aligning the bottom would basically be
int height = STRING_HEIGHT * chat.size();
int y = chatHeightOffTheBottomOfTheScreen - height; // assuming +Y goes down like pixels usually do
int x = anyOffsetYouWouldLike;
int width = widthOfTheLongestStringInTheChat;
[/cpp]
Got a question about the stencil buffer (Just so I can do it right):
Uhm... if the test passes, like f.e. all pixels have a stencil value of 1, you set the test mode to equal and the reference to 1, then draw something on the screen.
Are the pixels only drawn when the test passes?
[QUOTE=nullsquared;20360554][cpp]
std::list<std::string> chat;
void say(const std::string &str)
{
chat.push_back(str);
if (chat.size() > MAX_LINES)
chat.pop_front();
}
drawStrings(chat, ALIGN_BOTTOM);
// aligning the bottom would basically be
int height = STRING_HEIGHT * chat.size();
int y = chatHeightOffTheBottomOfTheScreen - height; // assuming +Y goes down like pixels usually do
int x = anyOffsetYouWouldLike;
int width = widthOfTheLongestStringInTheChat;
[/cpp][/QUOTE]
Thank you in advance, I will get to it later :)
[QUOTE=garry;20350374]
[hd]http://www.youtube.com/watch?v=XMlE_NExQ2o[/hd][/QUOTE]
Unna[B]mm[/B]ed player :v:
[QUOTE=s0ul0r;20360683]Got a question about the stencil buffer (Just so I can do it right):
Uhm... if the test passes, like f.e. all pixels have a stencil value of 1, you set the test mode to equal and the reference to 1, then draw something on the screen.
Are the pixels only drawn when the test passes?[/QUOTE]
Yes, the pixels are only drawn when the test passes, and the stencil operation only happens when the test passes.
[QUOTE=nullsquared;20365475]Yes, the pixels are only drawn when the test passes, and the stencil operation only happens when the test passes.[/QUOTE]
thanks :cheers:
If you have an array
Type array[10]
Is there a way to initialize them in a constructors initializer list?
[editline]02:47AM[/editline]
Also the constructor of the type in this situation has args.
Meh I guess I could just pass it into another method but I'd still like to know.
Sorry, you need to Log In to post a reply to this thread.