Sign in to follow this  

Adding text into a string while using SDL

This topic is 4740 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I found a small delema in my venture to make an online game. Using Winsock for online play you have to manually enter in an IP address to connect. The problem I just ran into, all text runs straight to a text file called stout, how the heck could I not remember that? Anyways, is it possiable to create a text box that I could use to enter in the IP address? I sure as heck hope so. BTW, I havent even created a screen yet, I just created the network code.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
not sure what you mean, but you can simply use the + operator on strings to add them togeather.

so it'd be something like this

//poll the keyboard for key presses

strIP += strThekeyJustPressed

///write it out.

Share this post


Link to post
Share on other sites
Quote:
Original post by Thrust
Hey, I found a small delema in my venture to make an online game. Using Winsock for online play you have to manually enter in an IP address to connect. The problem I just ran into, all text runs straight to a text file called stout, how the heck could I not remember that? Anyways, is it possiable to create a text box that I could use to enter in the IP address? I sure as heck hope so. BTW, I havent even created a screen yet, I just created the network code.


Not very easily its not. You would have to make your own custom library or use some screen widget to make a text box in SDL to enter text into. Loading the data via a file would be a lot easier in SDL. I hope this helps.

[edit] Accompishing what your asking in your second post is easy, just not making the text box, as you said in your first post.[/edit]

Share this post


Link to post
Share on other sites

This topic is 4740 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this