OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [mw/] [src/] [demos/] [nanox/] [info.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 673 markom
/*
2
 * Display the results of various GrGetsomethingInfo() calls.
3
 */
4
 
5
#include <stdio.h>
6
#include <conio.h>
7
#include "nano-X.h"
8
 
9
int main()
10
{
11
        GR_SCREEN_INFO  si;
12
        GR_FONT_INFO    fi;
13
        GR_GC_INFO      gi;
14
        GR_FONT         fonts;
15
        int             x, y;
16
 
17
        GrOpen();
18
        GrGetScreenInfo(&si);
19
 
20
        printf("rows = %d\n", si.rows);
21
        printf("cols = %d\n", si.cols);
22
        printf("bpp = %d\n", si.bpp);
23
        printf("planes = %d\n", si.planes);
24
        printf("ncolors = %d\n", si.ncolors);
25
        printf("buttons = 0x%x\n", si.buttons);
26
        printf("modifiers = 0x%x\n", si.modifiers);
27
        printf("fonts = %d\n", si.fonts);
28
 
29
        getch();
30
 
31
        for(fonts = 0; fonts < si.fonts; fonts++) {
32
/*              if(!GrGetFontInfo(fonts, &fi)) { */
33
                GrGetFontInfo(fonts, &fi);
34
                if(1) {
35
                        printf("\nfont = %d\n", fi.font);
36
                        printf("height = %d\n", fi.height);
37
                        printf("maxwidth = %d\n", fi.maxwidth);
38
                        printf("baseline = %d\n", fi.baseline);
39
                        printf("fixed = %s\n", fi.fixed ? "TRUE" : "FALSE");
40
                        printf("widths =\n");
41
                        for(y = 0; y != 3; y++) {
42
                                for(x = 0; x != 7; x++)
43
                                        printf("%2d", fi.widths[x * y]);
44
                                printf("\n");
45
 
46
                                getch();
47
 
48
                        }
49
                }
50
        }
51
 
52
        getch();
53
 
54
        GrClose();
55
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.