• Advertisement
Sign in to follow this  

I'm part of a big programming project. (question about windows programming)

This topic is 4742 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

Recently I picked up an internship at a place called Advanced Science and Technology. I told them I know C++, Visual Basic, html, can build computers, etc. Well it's all true to some extent, but the main problem is with the project he gave me. He wants me to create something with a green circle as the background taking up the entire screen. The entire time, there should be a small ball rotating in the shape of a square around the center of the green background circle. He's going over things that I should do and he comes to this and says, "Ok I need you to do this. You can do this, right? Not so hard." Well I didn't think it would be. The only problem is, it is. Most of my background comes from working with text based games. He wants this windowed. I don't know how to do that! I mean, if I understood windows programming, yeah, it wouldn't seem to hard to rotate a ball in the shape of a square, but I don't! This doesn't seem that difficult if I were to have a basic understanding of windows programming. I don't use Visual C++ (using a school laptop. Visual C++ is not installed so I use Dev-C++) so I have to rely on strict coding. I read there's like GDI and SDL among others. Which should I choose, and where would be an easy place to start?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
So you want us to do your job, that you aparently don't qualify for, for free. You want us to do this for you so that you can keep up a lie, that takes a job away from a different actually qualified person who may need the job more then you.

LOL...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
[google] is your friend[attention] [headshake]

Share this post


Link to post
Share on other sites
First of all, I don't want you to do my job. I just want to know which windows programming style would be appropriate for this project and where I can find a good tutorial that adequately covers the language or at least what I need to know.

Second, my school makes people intern for companies as a senior requirement. I'm the only person who enjoys computer programming at my school. This was also the ONLY job in the area that had anything related to computers that interns could work with. So my guidance counselor naturally put me in here.

Third, I don't get paid. There's no one else trying to get hired here, the company just wanted some extra FREE manpower to help on some projects. And trust me, I want to help. I know how to program, just not windows applications. All I need is just some simple advice as to which style of windows programming would be adequate and where I could find a decent tutorial.

Share this post


Link to post
Share on other sites
"a ball shaped like a square"
seriously wtf??

for the love of God, be more descriptive

there are enough ppl willing to point you in the right direction here - although no one will do it for you - but you need to be a little bit more clear

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Anonymous Poster
So you want us to do your job, that you aparently don't qualify for, for free. You want us to do this for you so that you can keep up a lie, that takes a job away from a different actually qualified person who may need the job more then you.

LOL...

Well put - took the words rite outta my keyboard

Share this post


Link to post
Share on other sites
oh and ignore the trolls, since none even seem to have read that this is a senior year thing and not an actual job

Share this post


Link to post
Share on other sites
No, a ball rotating in the shape of a square.

For example, if you make a train track in the shape of a square, the train will run along the square path; it hits one corner, changes direction until it hits next corner, moves to next corner, etc. So that's what I mean when I say the ball will rotate around in the shape of a square. When most people hear rotate they think of circular rotation such as planets around the sun.

Share this post


Link to post
Share on other sites
- does this need stuff like input boxes ?
- 2D or 3D ?

and more important: what does he need it for?

Share this post


Link to post
Share on other sites
You'd probably be best to tell your employer that you don't know windows programming, but you're willing to learn (I assume you are).

I find windows GDI easiest, but there's a lot more tutorials on SDL. If your employer didn't specify, it's likely that he wants it done in GDI (I could be wrong here, it may be best to check).
You can get a "Hello World" program from Wikipedia (Goto "Windows API (in C)" if that link doesn't take you to the section).
That should really be enough to get you started believe it or not. You want to do your drawing code in WM_PAINT. For a circle, you want to use the Ellipse() function, and for the square, you probably want Polygon(), assuming you do the rotation yourself (a little bit of sin() and cos() work), which will probably be easiest.
To get a fullscreen window you can change the CreateWindow() call to this:

hwnd = CreateWindowEx(0, //No extended window styles
szClassName, //Class name
"", //Window caption
WS_POPUP,
0, 0, // Window pos
GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), // Set w&h to size of the screen
NULL, NULL, hInstance, NULL);





However, you'll still need to learn the Win32 API fairly sharpish, and/or let your employer know. You won't be able to go much further without doing some heavy research.


EDIT: Oh, I misunderstood your square and ball thing. You'll just need Ellipse(), and you can work out the position to draw at using some trig. Xpos = sin(angle)*radius and Ypos = cos(angle)*radius with an increasing angle. You could look into using timers (SetTimer) for increasing the angle, or you can do whatever method you like instead.

Share this post


Link to post
Share on other sites
Nope, nothing big. All it's gonna be is a window with a green 2d circle and white ball rotating around it. I've written an algorithm on how the programming will be done and it's pretty simple overall, I just need to spend an hour or two learning how to make windows and like a 2d circle that can move.

Share this post


Link to post
Share on other sites
Quote:
- does this need stuff like input boxes ?
- 2D or 3D ?

and more important: what does he need it for?

I'm guessing the "boss" is giving it to him as an exercise.

Anyway, Kronikle66, Win32 will most likely get you what you need, if drawing a circle traversing a square is all you need. Here is a good overview of Win32 API graphics, and (page 3, I believe) includes code to draw an ellipse and a rectangle. Here also is a tutorial on the structure of Win32 - the message loop and creating a window, among other things.

Cheers.

<edit :: Lesson10 (on the second link) seems to have all you need.

Share this post


Link to post
Share on other sites
Well for windows programming start with the MSDN Windows API docs. All you really need to do here is get a simple window working, which isn't too bad. But if you've never worked with a message based event driven architecture before it will take some getting used to coming from the console based programming world. Start with the sample window app there and try to really understand what it does. All you will really need is a window with default behavior and a non-blocking message pump for animation. Once you understand the message pump in the sample take a look at PeekMessage() to get a non-blocking version working. Another option is always MFC, but for getting into windows programming fast I'd just go with straight windows api.

Another option would be sdl or even glut as long as they meet the requirements of the app. They will take care of the windows stuff for you, but you'll need to learn them, and you'll need to make sure they are acceptable with your boss. Depending on what this is used for the lgpl liscense used by sdl may be an issue for your company.

A bigger problem may be this "ball", that sounds like 3d to me. If you've never done that before this could be quite a challenge for you to get up to speed fast. You'll need to pick an API, either d3d or opengl (or more likely your boss will pick one for you). Then find some good tutorials (nehe for opengl) and get cracking.

Now having said all that, I think you really have a larger problem here than the technical challenges you are facing. Assuming that you didn't actually lie about your skills to get hired you need to learn how to manage expectations. It's not unreasonable to assume that a new hire, an intern no less, would take some time to come up to speed on the tech used by a new company, especially on a first job in a field. This is usually factored into hiring and management decisions. Work with your boss to understand the scope of your project and make sure you set reasonable expectations about the work required to complete the task. This task will require more work for you to do then it would for a more experienced team member, because you need to learn the tech. That should be built into the time estimate. Don't set yourself up to fail by not giving him a good understanding of the work involved for you. Also if he understands your training needs he may be able to help by putting you in contact with a more experienced programmer, giving you reference materials, even just giving you advice.

Even if you did lie and you’re completely out of your depth I'd own up to it now. Try to be politic about it, but he needs to know your abilities and get you the help you need if you are to have any chance at success. If you are lost on what he considers an "easy" task you won't have a chance if he ever gives you something "hard" to do.

Finally remember that at the end of the day this is an internship. You are there to give value to the company, but you are also there to learn. There is an expectation that you won't know everything right away. Be sensitive to the fact that they may not want to invest too much in training you, but don't be afraid to ask questions.

[edit]
Looks like a lot happened while I was posting ;)
Since it's just 2d this is a lot better. I still stand by my suggestions about working with your boss to make sure he understands your skill level though. You need to make sure that you get tasks that you can actually complete and that you get the resources you need. Good luck, it sounds like a great opportunity :)
[/edit]

Share this post


Link to post
Share on other sites
Thanks for the last two replies. You guys came through more than I would have ever thought possible.

As far as the whole situation with the intership goes, it was somewhat thrown upon us. I want to be a game developer when I graduate college so I thought this would be a very useful experience.

Let me explain the project for you guys. There is some equipment at the gym that consists of a platform placed on top of a ball, and people stand on this and try to balance themselves. Well, a client came to my boss and asked him to develop a system that will analyze the tilt the person is at and send the data to an attatched monitor which will then project how much the user is tilting, where his feet are placed, plus many other assorted features. Since my background is in game development, they want me to help out a bit by creating some simple games that can take advantage of this.

The one I'm working on now works as follows: You pick which track you want a white CIRCLE/DOT (ball was a poor word) to follow, circular, square-like, etc. and the dot will move automatically along the path and just loop itself. The user has control of a second red dot. When the user moves on the platform, the red dot moves with it. My boss is creating a DLL file which will make all that hassle very simple. Anyway, the goal is for the user to see how long his dot can stay on top of the rotating dot.

Later on, for another game, they want me to make a maze the red dot can follow. You have to navigate with your dot along a maze collecting objects. I can do this. I think I might have made myself sounds more programming illiterate than I really am. I've made some nice dos-based, 2d games, just never anything with windows. So that's what I really needed, something that will help me get used to a windows interface while programming.

Anyway, when my boss said it would be an easy project, he thought I would be using Visual C++, which WOULD make it easier. Due to restrictions, however, I can't install that program on this laptop. I told him just now that it would take me much longer that I had originally anticipated, as I would have to learn how to program this without a GUI. He understands and doesn't care how long it takes for me to learn this.


Now that that's out of the way, thank you, once again, for the great replies. I'm going to get right on the tutorials. Thanks again!

-Kronikle

Share this post


Link to post
Share on other sites
You can find a great tutorial covering all the basic aspects of win32 programming in C++ here (theForger's Win32 API Tutorial).

Sing along

Visit Dayzero Games for Classic Arcade Remakes.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement