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

Subversion Repositories orsoc_graphics_accelerator

[/] [orsoc_graphics_accelerator/] [trunk/] [sw/] [examples/] [bare/] [plustest.c] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 maiden
#include "orgfx_plus.h"
2
//#include "orgfx.h"
3
 
4
//#include "Bahamut.gif.h"
5
#include "Bahamut_cc.png.h"
6
//#include "Bahamut8.png.h"
7
//#include "pixtest.png.h"
8
 
9
int main(void)
10
{
11
        int i;
12
        int pos = 0;
13
 
14
        // Initialize screen, no double buffering
15
    int screen = orgfxplus_init(640, 480, 16, 1, 0);
16
 
17
        // Initialize sprite
18
    int bahamut_sprite = orgfxplus_init_surface(186, 248, Bahamut_cc);
19
//      int bahamut_sprite = orgfxplus_init_surface(186, 248, Bahamut);
20
//      int pix_sprite = orgfxplus_init_surface(4, 1, pixtest);
21
 
22
 
23
//      orgfxplus_fill(0,0,640,480,0x000f);
24
 
25
    orgfxplus_colorkey(0xf81f, 1);
26
    orgfxplus_fill(0,0,640,480,0xffff);
27
        orgfxplus_line(200,100,10,10,0xf000);
28
        orgfxplus_line(200,100,351,31,0x0ff0);
29
        orgfxplus_line(200,100,121,231,0x000f);
30
        orgfxplus_line(200,100,321,231,0xf00f);
31
    orgfxplus_alpha(64,1);
32
    orgfxplus_draw_surface(100, 100, bahamut_sprite);
33
    orgfxplus_alpha(128,1);
34
    orgfxplus_draw_surface(120, 102, bahamut_sprite);
35
    orgfxplus_alpha(255,1);
36
    orgfxplus_draw_surface(140, 104, bahamut_sprite);
37
 
38
        for(i = 0; i < 1000000; ++i);
39
 
40
    orgfxplus_curve(10,10,10,110,110,110,1,0xf800);
41
 
42
    orgfxplus_flip();
43
 
44
        while(1);
45
 
46
 
47
 
48
 
49
        while(1)
50
        {
51
                // Draw a bahamut
52
//              orgfxplus_draw_surface(40+pos, 50, bahamut_sprite);
53
//                orgfx_set_color(0xfff0);
54
//                orgfx_rect(40+pos,50,186+pos,248);
55
 
56
/*
57
 
58
                // Sleep
59
                for(i = 0; i < 1000000; ++i);
60
 
61
                orgfx_enable_tex0(0);
62
 
63
            orgfx_set_color(0xf000);
64
                for(i=0; i<40; i++)
65
                {
66
                        for(pos = 0; pos < 100; ++pos);
67
                    orgfx_line(100,200,140-i,200-i);  //vertical
68
                }
69
 
70
                for(i = 0; i < 1000; ++i);
71
 
72
            orgfx_set_color(0x0f00);
73
                for(i=0; i<40; i++)
74
                {
75
                    orgfx_line(100,200,100-i,160+i);  //vertical
76
                        for(pos = 0; pos < 100; ++pos);
77
                }
78
 
79
                for(i = 0; i < 1000; ++i);
80
 
81
            orgfx_set_color(0x00f0);
82
                for(i=0; i<40; i++)
83
                {
84
                    orgfx_line(100,200,60+i,200+i);  //vertical
85
                        for(pos = 0; pos < 100; ++pos);
86
                }
87
 
88
                for(i = 0; i < 1000; ++i);
89
 
90
            orgfx_set_color(0x00ff);
91
                for(i=0; i<40; i++)
92
                {
93
                    orgfx_line(100,200,100+i,240-i);  //vertical
94
                        for(pos = 0; pos < 100; ++pos);
95
                }
96
 
97
*/
98
                for(i = 0; i < 1000000; ++i);
99
 
100
//                orgfx_line(10,200,10,290);  //vertical
101
//                orgfx_line(10,200,100,200); // horizontal
102
//                orgfx_line(10,200,100,290); // 45 deg
103
//
104
//                orgfx_line(10,200,110,400); // between v and 45
105
//                orgfx_line(10,200,210,300); // between h and 45
106
 
107
 
108
 
109
                pos+=1;
110
                if(pos > 300) pos = 0;
111
 
112
                // Swap buffers
113
//              orgfxplus_flip();
114
        }
115
}
116
 

powered by: WebSVN 2.1.0

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