|
|
#1 (permalink) |
|
Ride em’ Yoshi
Join Date: Jan 2008
Posts: 182
![]() |
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 |
|
|
|
|
|
#2 (permalink) |
|
One of these days...
|
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. |
|
|
|
|
|
#3 (permalink) |
|
Ride em’ Yoshi
Join Date: Jan 2008
Posts: 182
![]() |
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 |
|
|
|
|
|
#4 (permalink) |
|
One of these days...
|
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.... |
|
|
|
|
|
#6 (permalink) |
|
Samus' Girdle
Join Date: Jul 2009
Location: Fair Lawn, NJ
Posts: 30
![]() |
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 |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|