|
|
Petskull
Maniac (V) Mad Scientist
From: 127 Halcyon Road, Marenia, Atlantis Insane since: Aug 2000
|
posted 06-28-2002 17:39
ok, I want to draw stuff on the screen using C.
anyone have any idea how?
I also know I need something having to do with VGA or VESA (a library or something)- but I haven't the foggiest....
Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342
|
Wuji
Bipolar (III) Inmate
From: Insane since: Apr 2002
|
posted 06-29-2002 01:02
This requires a basic understanding of how a computer monitor reads pixels and also how many pixels accross and down are available for writing. That 'is' if you intend on writing something using VGA pixel mode. Otherwise you will be dealing with some more complex algorithms/equations unless you step into an "Object Oriented Environment" such as C++, Java, Visual Basic.
A search of google.com or even more highly recommended http://groups.google.com will be a nice start. Also http://www.planetsourcecode.com
Have fun!
|
lallous
Paranoid (IV) Inmate
From: Lebanon Insane since: May 2001
|
posted 06-29-2002 09:05
i'ld also add that you'ld be mostly needing OpenGl or DirectX libraries or wing! ...
|
Petskull
Maniac (V) Mad Scientist
From: 127 Halcyon Road, Marenia, Atlantis Insane since: Aug 2000
|
posted 06-30-2002 05:03
I think I'm going to opt for the 'complex algorithms/equations' door, Wink...
...any good links for writing it in native C or a lib here or there?
Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342
|
lacapaca
Nervous Wreck (II) Inmate
From: home sweet home Insane since: Jun 2002
|
posted 06-30-2002 12:45
hmm. i looked at your projects at twistedport.com
how come someone who wants to write an operating system doesn't know how to "draw stuff on the screen using C"??
i'm confused...
[This message has been edited by lacapaca (edited 06-30-2002).]
|
Petskull
Maniac (V) Mad Scientist
From: 127 Halcyon Road, Marenia, Atlantis Insane since: Aug 2000
|
posted 06-30-2002 13:52
that's the point, tyke
I'm currently reading Practical C (O'Reilly) and it has about half a chapter devoted to graphic routines, but I need something a little more in depth.
I searched for 'C graphics' on google and I found some good stuff, but mostly a bunch of junk....
I wanted to know if anyone around the 'sylum had any cool links on the subject.
Do you have any, or did you just pop in to increase your post count?
btw, InI- I ran into this and thought you might like it: http://romka.demonews.com/index_eng.htm
Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342
|
lacapaca
Nervous Wreck (II) Inmate
From: home sweet home Insane since: Jun 2002
|
posted 06-30-2002 14:42
ok, sorry. in case of windows you might want to use directx. you could find plenty of documentation on that on the web.
in the most simplistic case (DOS) you can draw on the screen by simply writing in the video memory. the beginning address of the video memory depends on the video mode (mostly) being used. of course this way you will not be able to use any of the newer cards' facilities (3D). there are routines all over the web for drawing this way a line, circle, ...
hope this was more constructive. call me picky but i still think you should know this stuff when thinking about writing an OS.
btw. what do you mean by tyke??
[This message has been edited by lacapaca (edited 06-30-2002).]
|
Petskull
Maniac (V) Mad Scientist
From: 127 Halcyon Road, Marenia, Atlantis Insane since: Aug 2000
|
posted 07-01-2002 14:33
ooo, I found a good one here... http://www.brackeen.com/home/vga/
I know that, laca.... the OS is a long term goal.... these are the baby steps...
I guess I'm not really making an OS, just a console from which to make all the things I do a little easier.... and to reduce the overhead most IDEs come native with...
btw, just to let you know what I'm looking for- all the coding will be done in C... probably starting with VGA and graduating to something better (to get 800x600) once the basics are done... I don't want to use dlls because I don't want (a) depend on an OS, and (b) if I use a library or something, I want to be able to tear it up and look at the source...
Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342
[This message has been edited by Petskull (edited 07-01-2002).]
|
Synthetic
Paranoid (IV) Inmate
From: under your rug, Insane since: Jul 2001
|
posted 07-01-2002 16:22
Wow that sounds like a really interesting idea PS, I hope to see any results that come of that
If we meet and you forget me, you have lost nothing, but if you meet Jesus Christ and forget him you have lost everything.
|
lacapaca
Nervous Wreck (II) Inmate
From: home sweet home Insane since: Jun 2002
|
posted 07-01-2002 22:06
ok. got it. go petskull, go go!!
btw, do you know assembly? because sooner or later you'll bump into it (either you have to write a driver or something, or as you said you want to 'tear up' some library and then...)
if you're interested, i could send you some info on vesa (svga) programming and also on general graphics.
so think about it...
|
WarMage
Maniac (V) Mad Scientist
From: Rochester, New York, USA Insane since: May 2000
|
posted 07-02-2002 01:20
Drivers are programmed in C...
There is really not much use for assembly now a day. And for the most part it is actually slower than C by 33% due to humans tending to misuse memory locations, where as the C compiler's algorithms use them very effectively.
|
lallous
Paranoid (IV) Inmate
From: Lebanon Insane since: May 2001
|
posted 07-02-2002 09:05
very nice link PS, I've always been interested in how to draw circles in a fast way...and it was like i though...point by point using sin/cos ...
|
Petskull
Maniac (V) Mad Scientist
From: 127 Halcyon Road, Marenia, Atlantis Insane since: Aug 2000
|
posted 07-02-2002 13:25
synth... you got it...
laca, toss that info my way, man!
Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342
|
lacapaca
Nervous Wreck (II) Inmate
From: home sweet home Insane since: Jun 2002
|
posted 07-02-2002 14:29
petskull: may i send it through e-mail? (~350k)
WarMage: yeah, but still C with asm inlines....
[This message has been edited by lacapaca (edited 07-02-2002).]
|
lallous
Paranoid (IV) Inmate
From: Lebanon Insane since: May 2001
|
posted 07-02-2002 16:13
assembly will never die!
code:
_asm
{
push ds
push cs
pop ds
call next
db "[b]Assembly will never die![/b]",0xd,0xa,"$"
next:
mov ah, 9
pop dx
int 0x21
pop ds
mov ah, 0x4c
int 0x21
}
laca, can you toss it over here too?!
|
synax
Maniac (V) Inmate
From: Cell 666 Insane since: Mar 2002
|
posted 07-02-2002 16:43
Petskull: all the links in your Links section are fucked up. For some reason you link them with "../" in front which is wrong. Also, your e-mail link at the bottom of each page is done incorrectly in the same way.
|
lacapaca
Nervous Wreck (II) Inmate
From: home sweet home Insane since: Jun 2002
|
posted 07-03-2002 01:26
lallous: right you are, but DOS (real-mode) asm is... hmmm.. how should i put it... well, DEAD! god, i hated int 0x21!!!
graphic related info: here
another one: here
enjoy
|
lallous
Paranoid (IV) Inmate
From: Lebanon Insane since: May 2001
|
posted 07-03-2002 09:06
laca, well, yes i know real mode is dead!
i hated real-mode's segments limitation!
but i'm too lazy to write that one in protected mode!...
i like protected mode's memory addressing and stuff are easier!
|
evilclown01
Nervous Wreck (II) Inmate
From: Insane since: Dec 2001
|
posted 07-09-2002 16:03
If you are going to use 2d, which it sounds like you are, you should try SDL ( http://www.libsdl.org/index.php ) I found it a lot easier than directx. If you need some samples I can email you ones i've made, and the site has a lot to download.
evilclown01
|
silence
Maniac (V) Inmate
From: soon to be "the land down under" Insane since: Jan 2001
|
posted 07-10-2002 05:19
Hey, laca, could you send those to me too?
nospam@bluesky.as
Don't worry, it's a valid address.
|
Petskull
Maniac (V) Mad Scientist
From: 127 Halcyon Road, Marenia, Atlantis Insane since: Aug 2000
|
posted 07-10-2002 07:06
heh... I just saw that addy and got a little freaked out...
"hmm- ok, simply remove the words 'nospam' and we get.... um- no, wait... doesn't that give you... um.. no, that can't be it... maybe if I substract by 2...."
Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342
|
silence
Maniac (V) Inmate
From: soon to be "the land down under" Insane since: Jan 2001
|
posted 07-11-2002 01:18
Actually, I had to set up the nospam alias to cut down on the spam I keep getting. Once it hits the mail server, it points to my regular addy, but my filter throws all stuff sent to that addy to a filter folder that I can sort through.
I really needed it for sniffers that sift webpages for email addresses. But I'm looking out for your email.
|