FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
gfx_pset.c
Go to the documentation of this file.
1
/* pixel plotting */
2
3
#include "
fb_gfx.h
"
4
5
6
/*:::::*/
7
FBCALL
void
fb_GfxPset
(
void
*target,
float
fx,
float
fy,
unsigned
int
color
,
int
flags,
int
ispreset)
8
{
9
FB_GFXCTX
*
context
=
fb_hGetContext
();
10
int
x, y;
11
12
if
(!
__fb_gfx
)
13
return
;
14
15
fb_hPrepareTarget
(context, target);
16
17
if
(flags &
DEFAULT_COLOR_1
) {
18
if
(ispreset)
19
color = context->
bg_color
;
20
else
21
color = context->
fg_color
;
22
}
23
else
24
color =
fb_hFixColor
(context->
target_bpp
, color);
25
26
fb_hSetPixelTransfer
(context, color);
27
28
fb_hFixRelative
(context, flags, &fx, &fy,
NULL
,
NULL
);
29
30
fb_hTranslateCoord
(context, fx, fy, &x, &y);
31
32
if
((x < context->view_x) || (y < context->view_y) ||
33
(x >= context->
view_x
+ context->
view_w
) || (y >= context->
view_y
+ context->
view_h
))
34
return
;
35
36
DRIVER_LOCK
();
37
context->
put_pixel
(context, x, y, color);
38
if
(
__fb_gfx
->
framebuffer
== context->
line
[0])
39
__fb_gfx
->
dirty
[y] =
TRUE
;
40
DRIVER_UNLOCK
();
41
}
gfxlib2
gfx_pset.c
Generated on Thu Jan 23 2014 19:40:06 for FreeBASIC by
1.8.4