Draw rectangle?
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
Draw rectangle?
I need good ideas how to draw a rectangle.
I used this method
M_DrawTransPic (-20, 39, Draw_CachePic ("gfx/menu/A.lmp") );
M_DrawTransPic (-20, 39, Draw_CachePic ("gfx/menu/B.lmp") );
M_DrawTransPic (-20, 79, Draw_CachePic ("gfx/menu/A.lmp") );
M_DrawTransPic (113, 39, Draw_CachePic ("gfx/menu/B.lmp") );
A lmp looks like this _____
B lmp looks like this |
_______
|xxxxxxx|
|______|
This works but are there other methods?
Is it possible to draw a yelow pixel?
Like DrawYelowPixel (135, 2)
I used this method
M_DrawTransPic (-20, 39, Draw_CachePic ("gfx/menu/A.lmp") );
M_DrawTransPic (-20, 39, Draw_CachePic ("gfx/menu/B.lmp") );
M_DrawTransPic (-20, 79, Draw_CachePic ("gfx/menu/A.lmp") );
M_DrawTransPic (113, 39, Draw_CachePic ("gfx/menu/B.lmp") );
A lmp looks like this _____
B lmp looks like this |
_______
|xxxxxxx|
|______|
This works but are there other methods?
Is it possible to draw a yelow pixel?
Like DrawYelowPixel (135, 2)
- Stealth Kill
- Posts: 83
- Joined: Fri Dec 29, 2006 12:34 pm
You can write your own routines to do these (and you'll need to for drawing single pixels). Have a look at the actual drawing code in gl_draw.c - it's a hell of a lot simpler than may seem at first.
Draw_CachePic is fine for use in menus, but it's not really suitable for in-game use as it involves a load of run-time string comparisons (which are slow) and loads textures as required rather than at game start-up.
This is a very big subject so it's not really possible to be meaningful and helpful in the space of a single post, but if you like I can provide you with simple code for these that you can use as a basis for future experiments.
Draw_CachePic is fine for use in menus, but it's not really suitable for in-game use as it involves a load of run-time string comparisons (which are slow) and loads textures as required rather than at game start-up.
This is a very big subject so it's not really possible to be meaningful and helpful in the space of a single post, but if you like I can provide you with simple code for these that you can use as a basis for future experiments.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
I found this in gl_draw.c
=============
Draw_Fill
Fills a box of pixels with a single color
=============
Draw_Fill (50, 50, 10, 2, 0)
It fills a box but i can make 4 lines with it to make a frame.
thanks
=============
Draw_Fill
Fills a box of pixels with a single color
=============
Draw_Fill (50, 50, 10, 2, 0)
It fills a box but i can make 4 lines with it to make a frame.
thanks
- Stealth Kill
- Posts: 83
- Joined: Fri Dec 29, 2006 12:34 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest