View previous topic :: View next topic |
Author |
Message |
LoTeK Apprentice
Joined: 26 Jul 2012 Posts: 270
|
Posted: Thu Nov 22, 2012 8:16 pm Post subject: Terminal graphics programming (simple, old school games) |
|
|
hi,
I want to program simple games like monopoly, mastermind, etc and so far it works with a CLI. I've programmed it in eiffel because I currently have to learn this language (at first I hated it, but now I'm beginning to like it..). Now I want to add simple GUI, but I've never programmed any graphical stuff before. I've started a GTK tutorial, but I rather want just a window without buttons, toolbars etc... So I thought of the old console games, but I couldn't find anything on google.
Is C or maybe C++ the best choice for this?
do someone knows a good tutorial? |
|
Back to top |
|
|
Carnildo Guru
Joined: 17 Jun 2004 Posts: 594
|
Posted: Fri Nov 23, 2012 2:24 am Post subject: |
|
|
If you just want a window to draw in, and don't plan on doing any sort of fancy user interface, try looking into the Simple DirectMedia Layer (SDL). The old console games were generally quite tightly tied to the hardware they ran on, because they accessed it at a very low level. LibSDL abstracts most of that away. |
|
Back to top |
|
|
LoTeK Apprentice
Joined: 26 Jul 2012 Posts: 270
|
Posted: Fri Nov 23, 2012 8:43 am Post subject: |
|
|
thank you very much.. at least from short reading about it, it is definitely what I'm looking for!! It seems that one can also do quite fancy stuff (at least from a 80ies viewpoint ) |
|
Back to top |
|
|
LoTeK Apprentice
Joined: 26 Jul 2012 Posts: 270
|
Posted: Fri Nov 23, 2012 12:30 pm Post subject: |
|
|
I've installed:
libsdl
sdl-image
sdlmame
sdl-mixer
sdl-sound
sdl-pango
with success, but when I try: Code: | emerge --sdl-terminal |
if fails... output of emerge --info '=media-libs/sdl-terminal-1.1.3-r1':
http://bpaste.net/show/59894/
output of emerge -pvq '=media-libs/sdl-terminal-1.1.3-r1':
http://bpaste.net/show/59895/ |
|
Back to top |
|
|
paulj Guru
Joined: 30 Sep 2004 Posts: 511 Location: Wales, UK
|
Posted: Sun Nov 25, 2012 11:30 am Post subject: |
|
|
LoTeK - that emerge command should be Code: | emerge sdl-terminal | not Code: | emerge --sdl-terminal | (note the two dashes)
If it still doesn't work, can you post the actual result of Code: | emerge -v sdl-terminal | At the moment, the error is not evident from your information. I have just run the emerge command and successfully installed sdl-terminal and its dependency media-libs/sdl-ttf, so hopefully we can work out the solution together. One thing I did notice - from your second paste, you have Code: | * IMPORTANT: config file '/etc/portage/package.accept_keywords' needs updating. | This can be resolved by executing or etc-update (whichever is your preference) from the command line. Do this before running the emerge command.
Off-topic question - where did you get your eiffel installation from? Did you install it outside portage, or is there an ebuild in an overlay somewhere? |
|
Back to top |
|
|
paulj Guru
Joined: 30 Sep 2004 Posts: 511 Location: Wales, UK
|
Posted: Sun Nov 25, 2012 11:33 am Post subject: |
|
|
For tutorials, have a look at the videos on youtube from thecplusplusguy. Quite a lot there with SDL and openGL in C++. |
|
Back to top |
|
|
LoTeK Apprentice
Joined: 26 Jul 2012 Posts: 270
|
Posted: Sun Nov 25, 2012 5:01 pm Post subject: |
|
|
paulj,
the two dashes were only a typo in my post.. I've executed
btw what is the difference from etc-update and dispatch-conf? Till now I've always run etc-update.
after that I've tried it again with the same error message.
output of emerge -v sdl-terminal:
http://bpaste.net/show/60294/
I didn't found anything eiffel-related in the portage tree or an overlay (maybe because it isn't a very common language), therefore I've installed it from outside:
http://sourceforge.net/projects/eiffelstudio/files/
with the installation manual:http://se.inf.ethz.ch/courses/2012b_fall/eprog/
(Woche 1 getting started)
At the moment I don't know how to program and compile eiffelprograms without the eiffelstudio (which is similar to eclipse) |
|
Back to top |
|
|
paulj Guru
Joined: 30 Sep 2004 Posts: 511 Location: Wales, UK
|
Posted: Mon Nov 26, 2012 6:32 am Post subject: |
|
|
It is failing because when trying to link it can't find the python library. This suggests it is either looking in the wrong place, or the library is missing. Since portage runs on python, I find the latter difficult to believe, and I am not sure how to influence the former!
Anyway, lets try some simple checks.
What does the output of
Code: | eselect python list | give you?
Have you recently changed versions?
Have you experienced any other issues with python? |
|
Back to top |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Mon Nov 26, 2012 6:39 am Post subject: |
|
|
LoTeK wrote: | btw what is the difference from etc-update and dispatch-conf? Till now I've always run etc-update. |
The difference is that etc-update does not require you to examine each config file. dispatch-conf walks you through the changes in each file. The both do the same thing in the end. _________________ First things first, but not necessarily in that order.
Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box. |
|
Back to top |
|
|
LoTeK Apprentice
Joined: 26 Jul 2012 Posts: 270
|
Posted: Mon Nov 26, 2012 11:16 am Post subject: |
|
|
Code: | M2-01 local.d # eselect python list
Available Python interpreters:
[1] python2.7
[2] python3.2 *
|
Quote: | Have you recently changed versions?
Have you experienced any other issues with python? |
No, at least not intentionally...
I run : Code: | emerge --update --deep --with-bdeps=y world
emerge --depclean
revdep-rebuild
|
nearly every day... |
|
Back to top |
|
|
paulj Guru
Joined: 30 Sep 2004 Posts: 511 Location: Wales, UK
|
Posted: Tue Nov 27, 2012 6:24 am Post subject: |
|
|
Try changing to python 2.7 then install again:
Code: | eselect python set 1
python-updater
emerge -av sdl-terminal
|
I tried to install with python 3.2 and it failed (admittedly not with the same error message). I am currently running python-updater before trying again, but I will have to go to work before it finishes! |
|
Back to top |
|
|
LoTeK Apprentice
Joined: 26 Jul 2012 Posts: 270
|
Posted: Tue Nov 27, 2012 7:35 am Post subject: |
|
|
I've changed to python 2.7 and it worked..!!!
thanks..
btw, do you program in eiffel? |
|
Back to top |
|
|
paulj Guru
Joined: 30 Sep 2004 Posts: 511 Location: Wales, UK
|
Posted: Tue Nov 27, 2012 12:25 pm Post subject: |
|
|
Glad that is working!
No, I don't program in Eiffel, but I am curious! I will get it loaded on my computer when I have some more time and have a play. I do have the Bernard Meyer book about OO programming, so I would like to give it a go. |
|
Back to top |
|
|
LoTeK Apprentice
Joined: 26 Jul 2012 Posts: 270
|
Posted: Tue Nov 27, 2012 12:38 pm Post subject: |
|
|
ok, but when it is a pain in the ass at the beginning don't give up early, it gets better I think it's maybe the best OO language, because it's only OO and designed from scratch and not something that was added later like C++ (nothing against C++ of course...!!!)
please post back when you tried it a bit and tell me your opinion...
regards... |
|
Back to top |
|
|
|