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/] [drivertest.c] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 maiden
#include "orgfx.h"
2
#include "orgfx_debug.h"
3
 
4
#include "Bahamut.gif.h"
5
 
6
#define REG32(add) *((volatile unsigned int*)(add))
7
 
8
int main(void)
9
{
10
    orgfx_init(GFX_VMEM);
11
    orgfx_vga_set_videomode(640, 480, 16);
12
    struct orgfx_surface screen = orgfx_init_surface(640, 480);
13
    orgfx_bind_rendertarget(&screen);
14
 
15
//      orgfx_enable_colorkey(1);
16
    orgfx_cliprect(0,0,640,480);
17
 
18
    orgfx_set_color(0xf800);
19
    orgfx_rect(110 <<16, 110<<16, 115<<16, 115<<16);
20
 
21
        while(1);
22
 
23
 
24
 
25
/*
26
        // Initialize start of video memory
27
    orgfx_init(GFX_VMEM);
28
        // Initialize color depth and vga module
29
        oc_vga_set_videomode(640, 480, 16);
30
 
31
        // Initialize screen (additional framebuffers should follow after)
32
    struct orgfx_surface screen = orgfx_init_surface(640, 480);
33
 
34
        // Bind the screen as render target
35
    orgfx_bind_rendertarget(&screen);
36
 
37
        // Initialize texture
38
    struct orgfx_surface bahamut = orgfx_init_surface(186, 248);
39
    orgfx_bind_rendertarget(&bahamut);
40
 
41
    orgfx_memcpy(Bahamut, 186*248/2);
42
 
43
        // Bind the screen as render target
44
    orgfx_bind_rendertarget(&screen);
45
 
46
//      orgfx_cliprect(50, 125, 500, 300);
47
    orgfx_set_color(0);
48
    orgfx_rect(0, 0, 640, 480);
49
 
50
        int i;
51
        for(i = 0; i < 1000000; ++i);
52
 
53
        // Bind bahamut as texture
54
    orgfx_enable_tex0(1);
55
    orgfx_bind_tex0(&bahamut);
56
//      orgfx_srcrect(50,50,100,100);
57
 
58
        // Draw a bahamut
59
    orgfx_rect(20<<16, 100<<16, 206<<16, 348<<16);
60
 
61
    orgfx_rect(400<<16, 100<<16, 586<<16, 348<<16);
62
 
63
        while(1);
64
*/
65
}
66
 

powered by: WebSVN 2.1.0

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