Old 04-11-2009, 05:35 PM   #1 (permalink)
Ride em’ Yoshi
 
Join Date: Jan 2008
Posts: 182
d4rk ball3r is on a distinguished road
Default Hardcore question

I been programming(vb) for about 8 months and now i get a btter understanding of computers but im wandering how does the computer know what 2 do?like do they put these things in the computer?Im very curious.

E.G:
picturebox1.left +=4

how does the computer know. when i type that the picturebox should move 4 pixels. It amazes me how the computers know everything

Thank you for your help
__________________



Windslayer:d4rkpk3r-Rogue
d4rk ball3r is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-14-2009, 01:05 AM   #2 (permalink)
One of these days...
 
Eriond's Avatar
 
Join Date: May 2006
Location: Chillin' in Montreal
Posts: 1,039
Eriond is on a distinguished road
Send a message via MSN to Eriond
Default

It's all rather complicated. In effect it's massive amounts of very modular programming working together. Microsoft designed visual basic, and they allowed it access to a software library of windows called GDI+. It's a bunch of tools that allow people to give instructions to windows to draw things onto the screen.

The "screen" is nothing but a slice of memory inside your monitor, which tells the monitor which elements of which pixels to light up to a certain brightness. I think most drivers are standardized these days (you just plug in a monitor and it works), but what happens is that when Windows itself gets the command that says "draw something here", it goes through a whole bunch of tasks involving other windows in the system; your graphics card (in Vista anyway, hardware acceleration I don't think is used by default in XP) as well as the device drivers you have installed for your monitor. Basically, Windows finds an incredibly complex way of moving data from memory, where it's stored in your visual basic program, and in the GDI+ libraries, onto the screen, using probably tens of different interconnections and interchangeable modules.

So when you say picturebox1.left +=4, visual basic reads that instruction, and recognizes that it's incrementing a variable. It then passes something called an assembly language instruction to your CPU, which figures out that you've got an addition, and then, through some complex circuitry that uses some extremely extremely fast, small and expensive memory, does the math, and then spits back out the answer. This number is then used to overwrite a value in main memory, where the left coordinate of picturebox1 is stored, specified by the original set of instructions. What's kind of counter-intuitive is that Visual basic also has the attention of the CPU, and it is because Visual Basic is also using the CPU that is able to pass data around; it's just using the CPU at a different time.

Then, when GDI+ thinks it's time to draw things to the screen, it passes all the things that need to be drawn to Windows, and windows in turn does some incredibly complex things with them, and then spits them out as a bit-stream to your monitor over what's called the system bus (a kind of highway that connects all the parts on your computer to almost all other parts).

It's all very complicated. I'm sure I got a few things wrong in there, and also left out a whole bunch, but that's generally how it goes.

http://tldp.org/LDP/tlk/tlk.html

That is a pretty heavy textbook type reference for this sort of thing, but it's damn good. It explains basically how a computer works. It's kinda boring, but it's very understandable, even if you're not the technical type. At least, I think it was.

Hope this helps.
__________________

Outsider
3D Space Action Shooter/RPG in Development
http://www.youtube.com/user/outsidergame


OnRPG does indeed have a game development section, y'know....

Last edited by Eriond; 04-15-2009 at 07:20 AM. Reason: Updated to make more sense and now written when I'm not drunk.
Eriond is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-15-2009, 08:50 PM   #3 (permalink)
Ride em’ Yoshi
 
Join Date: Jan 2008
Posts: 182
d4rk ball3r is on a distinguished road
Smile

Wow thank you alot!! I actually understood what you said. Now im even more fascinated by the computer.I wanna be a programmer or anything involving a computer ,but my parents want me 2 be a doctor
__________________



Windslayer:d4rkpk3r-Rogue
d4rk ball3r is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-15-2009, 09:07 PM   #4 (permalink)
One of these days...
 
Eriond's Avatar
 
Join Date: May 2006
Location: Chillin' in Montreal
Posts: 1,039
Eriond is on a distinguished road
Send a message via MSN to Eriond
Default

Lol, well, tell them you want to be a Software Engineer. That sounds pretty respectable, and I guess it is. Plus you also get the engineer's ring.
__________________

Outsider
3D Space Action Shooter/RPG in Development
http://www.youtube.com/user/outsidergame


OnRPG does indeed have a game development section, y'know....
Eriond is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-16-2009, 08:54 PM   #5 (permalink)
Ride em’ Yoshi
 
Join Date: Jan 2008
Posts: 182
d4rk ball3r is on a distinguished road
Default

Perfect!(lol). I found out they teach c# at my school, im gonna take it next year.
__________________



Windslayer:d4rkpk3r-Rogue
d4rk ball3r is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2009, 12:10 AM   #6 (permalink)
Samus' Girdle
 
Join Date: Jul 2009
Location: Fair Lawn, NJ
Posts: 30
Major.Disaster is on a distinguished road
Default

Do what you love, don't listen to other's, because it's your life If you like dealing with computers, programming is a good field.
__________________
I'm a Free MMORPG Gamer. My favorite games at the moment are:
Exteel, S4 League and Atlantica Online.
Favorite websites are:
OnRPG
Digg
Major.Disaster is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT. The time now is 08:56 AM.


Powered by vBulletin® Version 3.7.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Onrpg, Copyright ©2003-2008, Spil Games