Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Terminal graphics programming (simple, old school games)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Thu Nov 22, 2012 8:16 pm    Post subject: Terminal graphics programming (simple, old school games) Reply with quote

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
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 594

PostPosted: Fri Nov 23, 2012 2:24 am    Post subject: Reply with quote

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
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Fri Nov 23, 2012 8:43 am    Post subject: Reply with quote

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
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Fri Nov 23, 2012 12:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
paulj
Guru
Guru


Joined: 30 Sep 2004
Posts: 507
Location: Wales, UK

PostPosted: Sun Nov 25, 2012 11:30 am    Post subject: Reply with quote

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
Code:
dispatch-conf
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
View user's profile Send private message
paulj
Guru
Guru


Joined: 30 Sep 2004
Posts: 507
Location: Wales, UK

PostPosted: Sun Nov 25, 2012 11:33 am    Post subject: Reply with quote

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
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Sun Nov 25, 2012 5:01 pm    Post subject: Reply with quote

paulj,

the two dashes were only a typo in my post.. I've executed
Code:
dispatch-conf

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
View user's profile Send private message
paulj
Guru
Guru


Joined: 30 Sep 2004
Posts: 507
Location: Wales, UK

PostPosted: Mon Nov 26, 2012 6:32 am    Post subject: Reply with quote

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
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Mon Nov 26, 2012 6:39 am    Post subject: Reply with quote

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
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Mon Nov 26, 2012 11:16 am    Post subject: Reply with quote

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
View user's profile Send private message
paulj
Guru
Guru


Joined: 30 Sep 2004
Posts: 507
Location: Wales, UK

PostPosted: Tue Nov 27, 2012 6:24 am    Post subject: Reply with quote

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
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Tue Nov 27, 2012 7:35 am    Post subject: Reply with quote

I've changed to python 2.7 and it worked..!!!
thanks..
btw, do you program in eiffel?
Back to top
View user's profile Send private message
paulj
Guru
Guru


Joined: 30 Sep 2004
Posts: 507
Location: Wales, UK

PostPosted: Tue Nov 27, 2012 12:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Tue Nov 27, 2012 12:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum