View previous topic :: View next topic |
Author |
Message |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Sun Jun 08, 2008 2:53 pm Post subject: 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) |
|
Back to top |
|
 |
mh

Joined: 12 Jan 2008 Posts: 909
|
Posted: Sun Jun 08, 2008 9:41 pm Post subject: |
|
|
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. _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines |
|
Back to top |
|
 |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Mon Jun 09, 2008 12:14 pm Post subject: |
|
|
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  |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|