Thread: Getting screen size - unix/linux terminal

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    2

    Getting screen size - unix/linux terminal

    Hi!

    I've been trying to find a way to get screen width and height in either rows and columns or pixels
    but all i can find using google is funtions in Windows or maybe C#.

    Is there anything in the C++ standard library that can give me what i want?

    //Stefan

  2. #2
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    Is there anything in the C++ standard library that can give me what i want?
    Standards ~= portable. So no, there is no portable way to do this, therefore its not in the standard. One of curses (programming library) - Wikipedia, the free encyclopedia or ncurses - Wikipedia, the free encyclopedia is probably a good start.

  3. #3
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    C++ is intended to be portable to just about all computers under the sun. "terminals" don't exist for most of them (embedded systems).

  4. #4
    Registered User
    Join Date
    Nov 2009
    Posts
    2

    Thumbs up

    There!

    I have now tried "curses" and I finally got it working.
    At first I ran in to trouble as soon as I even #include<curses.h>.
    It turns out it doesn't play well with <iostream> so i'm back to using printf() or in this case mvprintv() instead of <<.

    Thank You!

    //Stefan

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Adventures in labyrinth generation.
    By guesst in forum Game Programming
    Replies: 8
    Last Post: 10-12-2008, 01:30 PM
  2. mousebutton event sdl
    By mad_muppet in forum Game Programming
    Replies: 7
    Last Post: 08-09-2008, 02:11 AM
  3. Render text
    By Livijn in forum C++ Programming
    Replies: 6
    Last Post: 07-06-2007, 03:32 PM
  4. Error with a vector
    By Tropicalia in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2006, 07:45 PM
  5. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM