Joe.Z
Joe.Z

Reputation: 2745

What lib is usually to be used to develop a simple game like Tetris?

I am going to develop a Tetris in practice. But I have no idea how to start it, especially the graphic part - how to draw the frame and blocks? how to move them on screen? Could you please you refer me to some useful libs or tools?

Programming language is c. (if this is done, I am planing to do it again with c++ and python. :) Both Windows or Unix-like is ok. It's better if it is portable.

I know openGL, and DirectX is heavy-weight lib. dose it efficiently fit to a small game like Tetris? Any light-weight? which is better?

I would appreciate if you could refer me to some materials or links for this.

Thanks.

Upvotes: 0

Views: 192

Answers (3)

Jason
Jason

Reputation: 32520

If you'd like to keep your game in a window and not full-screen, then any library that implements some type of paintable canvas widget will work. Cross-platform candidates include Qt, WxWidgets, FLTK, GTK+, etc. If you want to remain on a single platform like Windows, then you can use a lower-level Win32 API like GDI+. As I mentioned in my first sentence, with most of these libraries/API's, you'd be looking to use their paintable canvas widgets, allowing you to draw the characters shapes on the window. You'd also use some type of timer event to periodically update the drawn window at fixed time intervals.

Upvotes: 1

Juraj Blaho
Juraj Blaho

Reputation: 13461

I would suggest SDL or Allegro. Both provide simple ways of getting input and doing graphics and audio output. And both are multiplatform.

Upvotes: 1

Tiago Peczenyj
Tiago Peczenyj

Reputation: 4623

You can use SDL - is simple and many platforms are supported

Upvotes: 1

Related Questions