Inside3D!
     

Draw rectangle?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Stealth Kill



Joined: 29 Dec 2006
Posts: 83

PostPosted: Sun Jun 08, 2008 2:53 pm    Post subject: Draw rectangle? Reply with quote

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
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Sun Jun 08, 2008 9:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Stealth Kill



Joined: 29 Dec 2006
Posts: 83

PostPosted: Mon Jun 09, 2008 12:14 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Page 1 of 1

 
Jump to:  
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