NewI\O screen_test
screen_test.nio is a small app that demonstrates drawing a screen full of text. Hit any key to exit.
Here is a screenshot:
Here is the sourcecode:
Updated: 01/25/06 ccn
/******************************************************************************
*
* screen_test.c
*
* Copyright (C) 2002, 2006 Chris Nystrom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but without any warranty whatsoever.
*
* For more license information see:
*
* http://www.gnu.org/copyleft/gpl.html
*
* Contact Author at:
*
* Chris Nystrom
* 11013 Prairie Dove Circle
* Austin, Texas 78758
*
* E-Mail: cnystrom@gmail.com
* Blog: http://conversazione.blogspot.com
* AIM: nystromchris
*
* Soli Deo Gloria
*
*/
#include "nio_lib.h"
#define LINES (24)
int main(int argc, char *argv[])
{
int i, font;
color black, white;
nio_app_init("screen_test", "0.1");
black = nio_get_color("black");
white = nio_get_color("white");
nio_set_screen(800, 340, black);
nio_clear_screen(black, TRUE);
font = nio_load_sys_font(NIO_DEFAULT_FONT,
NIO_DEFAULT_PTSIZE,
NIO_STYLE_BOLD, white, black);
nio_term_init(font, black, 0, 0, LINES, 80);
for (i = 1; i < 10; i++)
nio_printf
(TRUE,
"%d 3456789|123456789|123456789|123456789|123456789|123456789|123456789|1234567890",
i);
for (i = 10; i <= LINES; i++)
nio_printf
(TRUE,
"%d 456789|123456789|123456789|123456789|123456789|123456789|123456789|1234567890",
i);
// nio_print("25 456789|123456789|123456789|123456789|123456789|123456789|123456789|1234567890\n");
nio_pause("");
nio_free_font(font);
nio_exit();
exit(0);
}
