FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
gfx_access.c
Go to the documentation of this file.
1
/* low level screen access routines */
2
3
#include "
fb_gfx.h
"
4
5
6
/*:::::*/
7
FBCALL
void
fb_GfxLock
(
void
)
8
{
9
if
(!
__fb_gfx
)
10
return
;
11
12
if
(
__fb_gfx
->
lock_count
== 0)
13
__fb_gfx
->
driver
->
lock
();
14
15
++
__fb_gfx
->
lock_count
;
16
}
17
18
19
/*:::::*/
20
FBCALL
void
fb_GfxUnlock
(
int
start_line,
int
end_line)
21
{
22
FB_GFXCTX
*
context
=
fb_hGetContext
();
23
24
if
(!
__fb_gfx
)
25
return
;
26
if
(start_line < 0)
27
start_line = 0;
28
if
(end_line < 0)
29
end_line =
__fb_gfx
->
h
- 1;
30
if
((
__fb_gfx
->
visible_page
== context->
work_page
) && (start_line <= end_line) && (end_line < __fb_gfx->h))
31
fb_hMemSet
(
__fb_gfx
->
dirty
+ start_line,
TRUE
, end_line - start_line + 1);
32
33
if
(
__fb_gfx
->
lock_count
!= 0) {
34
--
__fb_gfx
->
lock_count
;
35
if
(
__fb_gfx
->
lock_count
== 0)
36
__fb_gfx
->
driver
->
unlock
();
37
}
38
}
39
40
41
/*:::::*/
42
FBCALL
void
*
fb_GfxScreenPtr
(
void
)
43
{
44
FB_GFXCTX
*
context
=
fb_hGetContext
();
45
46
if
(!
__fb_gfx
)
47
return
NULL
;
48
fb_hPrepareTarget
(context,
NULL
);
49
fb_hSetPixelTransfer
(context,
MASK_A_32
);
50
51
return
context->
line
[0];
52
}
gfxlib2
gfx_access.c
Generated on Thu Jan 23 2014 19:40:05 for FreeBASIC by
1.8.4