Session Start (nullserver.fr.eu.diboo.net:#itcc): Thu Jul 01 20:30:05 2004 what does everyone think so far of the slides? alright, is there an option in TS to host? OOO can i call u Professor Psy Oh, so, you still might be able to take connections? Gah, you have to get TS server not TS client I got through them, but the last few were pretty rough Slides are cool. Is it up now then Wolf? the slides are good I have TS server, i've ran it forever yeah i think so, if not it's my router my game clan gets on it all the time no problems hold on i'm getting the server k k err r Nope. Error same here same WTF I can't figure it out it works for them, Ok, I'll wait for ya Wez err i'm quitting netmeeting though me too ok guys, so first off, what are some errors people have not been able to resolve yet when compiling the HW0 material? k *** Signoff: Sargos (Connection reset by peer) anything? has everyone gotten the first two apps to compile then? Yeah, from help lol it compiled fine for me on visual c++ 6 I actually had no problems with it. Except when you had us actually force errors. VS.NET 2004 2003 that is *** Anonymous (~Anonymous@diboo-3A94ADCC.gt.rr.com) has joined channel #itcc no errors haven't even look at it yet ;/ *** Anonymous is now known as Sargos mine worked, but when i made changes to the code and tried to recompile my vs 2005 froze up and refused to exit yes Zinoview: did you turn on the Level 4 errors then? it won't stay public Zino: what do you mean by force errors? Hmmmm. The level 4 errors? the ones u made us put in im guessing Oh, no, if I remember right, you had us try to compile without "using namespace std" so there was no references for cout... i havent got the HWo finished keep getting windows.h thing yeah like comment out using namespace std and see what errors there were Zino: right, those are actually warnings ... they were just unreferenced parameters in the WinMain function kheh, i had the same problem, there is a whole topic on it in the boards Ahhh. any luck on teamspeak? HUH? what apps are we talkinga bout, we already got hmk ? i tried fixing it with the tools>options>VS C++ directory and that was a no go pre-homework lol it wasn't due Actually that was on the HelloWorld, not the HelloGraphics.... I did also have the runtime error when trying the graphics program, like you stated in the forums we have posted HW0 ("pre-homework") at (Link: http://pclx.com/itcc)http://pclx.com/itcc oh ok SETTING UP THE SERVER NOW yay i apologize for the runtime error, we're getting it resolved yay :-D is hw1 going to be on the web tonight? yes cool cool well, the main way to learn programming is through practice You mind typing in bold? sure no big deal. yeah thanks Thanks. :) Why are we using a custom framework anyway? Why not draw on a windows form? change ur text colour and stand on a stool lol lol thx i think bold is good enough... lol ok, windows programming using MFC is rather complicated lol we thought that using graphics would be a lot more exciting for people I like the font treatment.... yea graphics is coo yup yea mfc? ID3DXFont->DrawText( wez hows the server coming? one minute *** Signoff: Zinoviev (Connection reset by peer) ID3DXFont exists, yes, but it uses DirectX, and DirectX is pretty complex for a beginner the framework itself uses DirectDraw, which is from DX 7.0 *** Anonymous (~Anonymous@diboo-2118FE39.evrtwa1.dsl-verizon.net) has joined channel #itcc *** Anonymous is now known as Zinoviev that's ok this class is recommeded for ppl who dont really no much of ne C++ or C right? daniel, do i need to log into superadmin or admin I got logged out. khetra: yes superadmin ok, so the way to learn programming is through practice :) get a book from the library and follow along with these lectures and actually program things i always get lost when i get to more complicated stuff like pointers and classes i think as we get started with graphics you'll have a lot of neat ideas to program yah i went on amazona few and went shopping crazy *yawn* Less off topic stuff =\ bigmano: i agree, that's tough stuff ... but i really think that this framework will make both easier i didn't think of the library, good idea I bought: Practical C++ Programming: O'Reilly Less psy talk since we'll have a pointer to the video buffer cool and we'll actually get to see the results of what we stick into offsets from that pointer ok any ideas on how C++ is different from C? (slide 5) Object Oriented. because c++ is oop alright folks i've never done this before but hold un just be patient nice and what is OO? object oreinted!! (spelling) programming focused on encapsulation? with OO, we think in terms of OBJECTS, like chairs and people (spelling) yah there are certain properties that objects have like color ...density shape? and they can inherit attributes from superclasses.. and there are certain subclasses of objects, like a Postal Worker is a type of human actions... too exactly so a human can do things like walk C++ has been shown to be more intuitive apps usually take less time to write 24.197.197.120 try to connect and people understand it easier with teamspeak ok in general error. err password is shank error eer argh shank is the password ERROR error lol error uhm...one second...superclasses are child classes? err error. err ergh Actually it doesn't matter what we call them just keep talking. so is there going to be a lecture tonight or not/ yes a child class is something like a POstal worker is a type of human Error. Elfs: i believe this will be the closest we can get i'm afraid ... server uptime is 8 minutes now i don't understand why this won't work wreak isn't going to be able to host the TS like he said :( Okay. our host was killed and he's trying to restore it so C++ wraps things up faster then C ? ok superclasses are the ones at the top of the tree so what are we going to start off with? So, what's the lesson plan? we're doing it lol i'm following the lecture notes on-line :-) or should u say bottom of the tree lol Okay :) top i'll also talk for an hour, save that as an mp3, then post it on the site if you'd like to download it later ok cool so subclasses are childclasses? what are childclasses?? :) cool but subclasses underneath can inherit their attributes and have more im confused lol i'll also post this transcript So, we've given up on teamspeak, right? thanks *** Signoff: Xilo (Quit: PJIRC forever!) looks like it lets try ventrillo next time ok well everyone shut it, let me prof speak he stuff so after this check the site tomorrow and hopefully there will be an mp3 of this lecture with me talking and this log WAIT I FORGOT TO FORWARD THE PORT Cool. ok lol next week we'll make absolutely certain that we are running smoothly, so please stick with us sad. ok ok k i consider most of the experience of this class to be the online communication, and most of that is not done in the lecture part :-) Is there a username wezman? now (Slide 6) C/C++ comes with a lot of standard commands that you can use it includes things that for instance can handle strings of text, it can manage memory, etc however, since C is not platform-specific The SDKs slide? things like Windows commands and DirectX commands are not standard ware yes connection established bad name though so i take that back So Microsoft and lots of other groups have released SDKs, Software Development Kits, to help us use other products such as Windows i'm in!! C can't handle strings natively? I'm in too dude, teamspeak is up link engaged ok let's try this i hear Zinoviev it says "Bad Name" Can anyone hear me? zino sounds mad lol bad name with me also yay i don't know how to talk hehe Whats password again? new player what are the setttings??? shank shank just now what's the default talk button? what's the Login Name and Password? shank is the password no login pass is shank there is no NAME say something again psy shank got it yes yes yea lol whats the talk button :\ *** Signoff: wezman2k (Ping timeout) can everyone join wez's server? i am 24.197.197.120 ... password 'shank' yes shank is the what password the channel pass or user? Chaos, lower your bitrate lol mine stutters when more than 1 person tries 2 speak i have a suggestion... only psyklic talks in teamspeak otherwise it gets confusing i agree hehe yup i cant get in Good idea m :D! Sounds like a plan otherwise its crazy lol We can ask questions through chat wait for me guys chaos begs to differ yea lol Chaos...? i cant get in chaos omg just mute Chaos turn your mic off cant u mute ppl yay you have speakers? everyone turn mics off but him lol im in Everyone turn on push to talk omg lol is that his kids in the background? what the f*ck! rlui haha AHH! mute!! Disconnect your microphones =\ i can't hear psyklic :/ turn your mics off pls muteeeeeee omgggg ong ong lol lol i cant here anything but rlui its like im trying to tune the right radio station in Click self-->MUTE MICROPHONE your connection to the server has been terminated Holey Mackerel. Server died yeah i can't get in either ok that was fun wow, that was a disaster :-P what happend to the server lol died =[ lol lol lol yes major disaster what the crap chaos wow Just post instructions on how to mute yourself and it will be fine Nuclear bomb go off on the server? i believe so the worst thing was the guy with the kids lol cant u setup server for one speaker? yeah yea rlui No doubt only instructor should have mic on anyways I have to go go to options and do press button to talk later bye later sorry :P later ok later what? hey guys, i don't even have a mic connected Click self-->Mute Microphone. THen you will have an icon next to your name thats mute. oh cya i'm here *** Signoff: JW (Quit: PJIRC forever!) ok so is the server running again? Are we going to try again? server dead error ok guys, no more server :<< do you know what your bitrate is set to, psyklic? lol no sorry i'm just going to finish like this thats ok Ok, sounds good ok k ok so wreak wrote something on the boards about why he didn't have the server running ok and next time we'll do everything possible to have this working please follow along in your slides (Slide 7) may i have the link for the slides lol (Link: http://pclx.com/itcc)http://pclx.com/itcc i have the old ones thx so it turns out the lowest language you can use to talk to your processor is called 'machine language' everything you know is made up of zeros and ones in a computer and machine lang is no exception however, it's really tough to read by hand and only part of it can be converted to human-readable form so which is lower, assembly or binary? the output of this is called 'assembly language' binary binary alright so when you use that, you're directly talking to the processor, command by command telling it what to do so with C, the EXE you make is actually a bunch of machine language that directly talks to the processor no runtime and when you write code, like ... "if (i == 0)", then that directly translates to machine code and thats what the compiler is for right, to convert to binary or assembly? yes converts to binary i think binary? ok if you want to call it binary :-) an exe is assembly... binary/machine language right. ? ok continue this can be different for different operating systems and processors so a separate compiler per OS and processor is necessary although the different OS compilers are usualyl pretty similar if they use the same processor (Slide 8) ok, so when we build a C++ project we start with code then we conver that into *object files* only ONE source file gets converted into ONE object file in general and this step is necessary b/c we can spread code out among lots of files lots of files and some code needed in one file might be found in another *** CuMSh0tz (~wezman2k@diboo-3F16956B.man.mn.charter.com) has joined channel #itcc well am i missing out on anything the compiler can't find the code in another file if it hasn't parsed it yet so we make lots of object files and then after the COMPILE stage, there's a LINKING stage where it takes lal of the object files and LINKS them together *** CuMSh0tz is now known as wezman2k after that, if it's found all of the necessary files what is parse exactly? and it has code for all of the defined symbols is that where the includes come in? whats a symbol? it parses your C++ code and converts it into object files/a combination of machine code and special compiler files a symbol just stands for something else include files in fact like a variable? yea are usually a bunch of symbols that are defined elsewhere in a file so includes usually say "there's code out there that does THIS" but we actually need to parse that .cpp file to find the code so what's important out of this is we go through COMPILING then LINKING and then you get your EXE and this whole process is called BUILDING a project (Slide 11) you can see that in Visual Studio, these terms are used in the drop down menus so compiling is parsing the cpp files into their own object files which are then linked.? Why is it not just one step? Why are .obj files necessary if they arent used again? that's exactly right :) the OBJ files are an intermediate form ... let's say that we change a single thing in one file but not in any other file it's a lot faster only to have to recompile the one file so we can use the precompiled object files as sort of a speed up in thisc ase so its like a backup? does that make sense? yea not a backup, the object files are mainly machine code already yep so humans don't code object files? they are already made? if we had to compile an ENTIRE project every time we made a change, it would be very slow right, the compiler will make object files for you k (they're mostly that human-unreadable stuff anyway ;)) so what do you do when you make a change gotcha relink them? but don't get that confused with objects.. and classes... this is what makes cpp better than other langs? ok the CLEAN step you see is removing a bunch of the intermediate files like OBJ files yes it recompiles the files that need to be and then relinks them no, most languages can do this what is the use of cleaning the intermediate files? to save hard drive space :) Very cool, never saw the clean function before! they're usually very large oh :) (Slide 12) ok so you've witnessed some compile-time errors :) let's say it can't find a certain #include file like windows.h :) right? it then can't convert a file into object code! so that's a compile time error also, what if you spell a command wrong? it ahs no idea what you're saying! so that's a compile-time error what about a linkage error? is that a logic error too? nope k a logic error is something like that framework bug you noticed Can't link two files because one is missing or something? ok or actually, that's a run-time error, probably somewhat borderline zino: that's a linkage error Gotcha forgot to put a command in (missing your cout)? Goply: if you forgot a cout, that's a logic error right, good one! are logic errors ones that compile ok but have undesireable output effects? for instance, i forgot to pause the text before it left the window that's my error it's something i didn't want to happen but it's perfectly legal code-wise yes so that's a logical error OoOO Ari: yes worst mistakes ah!! ok now i get it yep, hardest to catch Linkage-errors std::system("pause"); let's say that we say there's a function somewhere wez: hey, good OO one :) lol i had to use it in something i wrote and we call the funciton, but we never provide the code for it so the compiler would compile the file OK but it wouldn't be able to find the code for part of the file *** Signoff: WolfSpring (Connection reset by peer) we tell it , HEY, there's some code somewhere that will put a pixel on the screen and it'll go here actually if you use a function without defining it doesn't it give you a compile-time error but the linker can't find that code, that's a linkage-error except main right, that's a linkage error main()...excuse me Like if you provided a prototype, but never defined the function right? and finally, a run-time error is something like that bug in my framework it isn't noticable until runtime when it says there was a corruption Zino: exactly, that's a linkage error :) (Slide 13) is that like not implementing an interface in java? ok, so we say #include Ari: yes you can think of #include as being replaced by the file you mention so instead of #include "Queue.h" it replaces that whole line with the contents of Queue.h what is the difference between the tags so could you somehow mess up your program if you get the order of #include's wrong? like #include yes so what ever is in queye.h will be put in that spot? but not usually and #include "Queue.h" yes you can think of it that way the way the compiler implements it could be different like server side includes somewhat yes You can do paths in #include statements too, right? paths? #include "../../myfile.h" like.. system directory paths? i think he means like a directory yeah so you can put whatever you want to in a header file, even code yes paths work :) sweet *** WolfSpring (~WolfSprin@diboo-15D0F03.net1268.nc.sprint-hsd.net) has joined channel #itcc Why are header files even needed? could you write an entire program with just headers? but in general you shouldn't because code is supposed to go in .cpp files! yes you could! why is Queue.h in quotation marks and is not? Ari: that's what i asked but let's again say you have code spread all over the place next slide :) header files are used to organize the code if you use paths, wont it have problems when installed on a differant computer? is there a way around that (or is that something to talk about later?) you need to tell the compiler that HEY, i have a SetPixel function ... somewhere and I'm going to send that function certain data and this is what i'll send it -- an x position, y pos, and color when programs start to get pretty large, it can get complicated having all of the function declarations in the cpp file so you'll do that in a header file, tell it that a certain block of code EXISTS and this is the data i'm going to pass to it wez: exactly in general, you want to make your programs readable :) it's basically just a system of organization (Slide 14) so ... we can #include things using "" or <> yeah that was my question what's the difference if we use "" then the file to include will be in the SAME DIRECTORY as our .cpp file ah ok if we use <>, then the file to include will be in a directory that we told the compiler about earlier also if u want to use some code in a different program so windows.h oh yeah, i forgot, so the <> is in some other directory i don't know where windows.h is! that is in visual studio though right i could have installed VS in any dir on my computer! yes visual studio knows imagine if u had to copy/paste all of the windows.h stuff into your program to make it work so if i pass around my code to you And you specify it in your VS project or the VS Global settings i shouldn't put the path to windows.h or you would never be able to find it Right? (or you can anyway...) so right you specify where windows.h can be found in your global settings and that way i can share my code with you isnt' that already done though in VS? and not have to worry about where exactly windows.h is stored yes it's usually aleady done does that make sense? i can include windows.h and use that code without having to mess with anything really yup Yes :) yes ok yea (Slide 15) these are comments comments rule if you type // then everything after it is not parsed by the compiler comments are my favorite part of a C++ program so you can type in human-readable stuff :) lol yay the key is not to undercomment and not to overcomment when you write words, don't just say exactly what the command is which is hard i think it's better to overcomment than it is to overcomment just to make it understandable SetPixel(0, 0, ...) // Sets a pixel is dumb oops, better to overcomment than to undercomment lol do comments take up space? I mean, do they affect a program's speed? but if you have a lot of SetPixel() commands in a group, you can say // Draws a star but that can't hurt though daniel can it? Chaos: no speed changes alright, good it can affect compilation speed, but very minorly they aren't even parsed so put in as many as are needed (Slide 16) so the compiler just ignores it right ok so first off notice we have our #includes alright since i was messing with the TS server earlier can you give me a brief explanation on what it is to "parse" something or what the parser is sure yah plz the compiler will analyze every line of your code and break it down into different symbols hehe same thing i asked asm? that's basically what a parser is k you can write a parser so what's the difference between the compiler and the parser that just analyzes a sentence and breaks it into words, right? the compiler?' the compiler will try to connect all of these symbols and actually convert them into object files the parser will just figure out the important parts of the code and how you have organized your writings not the best expl, but that's basically it : i see i get it now ic ic so a parser would parse a sentence into words parser tries to understand your code : a compiler translates it into machine language. a compiler might try to "understand" the word's meanings alright now i understand c++ lol ok lol so we have the #includes take a look at int main(void) this is where our app will start when we run the EXE, it will start with whatever code is inside those braces its not nessecary to have the void in the () is it? so in this case, the cout command no it's not elf he's just saying it returns void ok cool the same as not returning anything at all imo, you should have it to explicitly say that there is nothing there No it returns int heh no wez. Actually, it returns int. it saying it doesn't take any arguments. i thought that was the input type and it returns int i believe that that is what the official ANSI C++ standard says yeah my bad i got caught up yes, it returns int how often should main be like: main(void) ? int? integer is it possible for it to be main() ? thanks stop yelling at me yes, but not according to the ANSI C++ standards i believe lol ok get it lol there are two main forms of main you can have one is int main(void) the second is a little more complicated that we won't get into but it allows you to pass in paramters after your program name from thec ommand line Another is void main(void) or void main() ;) in this version, you can't pass command line paramteters in no that's not in the ansi standard void main() is not right I know that. ok ... just remember that the point of entry is the main function :) now lol cout is 'character out' ok i don't see main() in all source files though *** Signoff: WolfSpring (Ping timeout) that's correct, you only need one main() per PROGRAM *** WolfSpring (~WolfSprin@diboo-15D0F03.net1268.nc.sprint-hsd.net) has joined channel #itcc some source files are made up of supplementary code no what i mean is i don't see it anywhere anywhee in the source if it isn't in the source, then the code won't compile into an application dangit lost internet, can someone save all of this for me so i can have a complete lecture hmm, well i'll have to look harder than there could be a WinMain() for windows apps *then ok ah so the << there means that the text is going to the screen for display so it's going sort of 'toward' the 'out' command that might be one way to remember it << is actually used in lots of different commands writing to cout but i'm not going to explain it here right and 'endl' is end line << is not bitwise left shift? it points in the direction the information is flowing? yup that's the C definition Save that for later Goply: sort of main(void) is old C style, not really used anymore. Zino: yes, that's another use for << :) Sargos: right ok also important there are semicolons after every command except for #includes and int main(void) and braces remember those even function definitions? not on function definitions isnt there a ; after classes and structs though? they do go on function declarations elfs: yes how come ? Good one. haha that's a good question :) because bjarne wanted to piss people off i'm not sure i'm sure that's why isnt it because you can declare the varible inside of it? Could you please explain what cout is and what << is. I know what they do. perhaps ... although you can declare vars inside of function definitions too << is an operator cout is command, right? sure, cout is a function are we suppose to be understanding what ur talking about right now? lol whats endl do? vars? << is the put to operator no, not really a function? but i mean u can declare the class outside of the class {} but inside the ; huh? this is just a sample program cout << mean put to cout put whatever follows onto cout therefore it prints to the screen yea im sorry wez: yeah, that's all you need to understand for now is cout the same as cout.put() then? Or not? msdn.microsoft.com (check it out afterwards for info) we'll get into this stuff later Will we? ;) std::cout << "yes, this is blah" << "endl; all of that is put to cout thank god (Slide 20) now, i hope to use a graphics framework for this course so that we can learn about C++ graphically rather than having to use text all the time things will be better once we're more organized me too psy: sry and i think that even after this lecture you'll be able to use graphics in a simple way np OMFG I got my TS back up, prob was I was using opera, not IE in opengl? a PIXEL is a "Picture Element", the smallest dot on your screen that can be lit A little late now... ;) wez: no i never knew that picture element right sweet but after this course will i be able to move on to opengl? and its size is different on different display resolutions wez: yes if you put your head really close to your monitor cool you can make out individual pixels lol for instance, on text it's a little jagged sometimes yeah i see them! hehe omg wow or in games there are jagged lines lol ic ic i love pixels watch out its bad for your eye :p indeed (Slide 21) lol need new glasses ok, this is the basic graphics framework it looks a little more complex ok note the #include at the top remember that that's relative to the dir the .cpp file is in! Path included! yes! second, that #pragma is like a really weird #include Can you explain the .lib file a bit? yes what is pragma a .lib file is like an object file pragma is just a special preprocessor command that lets you do LOTS of different things So, its not fully compiled like a .dll pragma is also bad unless you are always using VS.NET ;) right, actually a .lib file contains symbols for the .dll well.. not .NET specifically, but VS OK, to try to explain this better: a .lib file has an associated .dll file with it i was curious about what the NULL does in your code .dll is just code without a main() right? the .dll file contains the compiled code in machine language oh Chaos: yes Goply: just a sec I see. So, like with DirectX, you include the .h file & .lib file and it all points at the .dll file ultimately. np sorry didnt mean to interupt yes Zino, the .dll contains the code and the .lib contains sort of a map to what's in the dll Cool. Thx. :) so your application can use the .lib file to see how to talk to the .dll the reason i made it this way is because now you don't need the DirectX SDK to compile this code the .dll file must use the DX SDK for compilation but your code will never use the DX SDK Yep, you're using GDI... but now I understand .lib files better. Goply: that's a while statement, while itcc->Flip IS NOT Null...run the while statement well, i'm actually using DX ok that's still a little fuzzy Oh, I gotcha. but when you run the .exe, we need to have the .dll in the same directory for it to work b/c there is code in the .dll so to actually make the dll u need the dx sdk, but we dont need it? right that's it so the .dll just contains everything required from the DX SDK the .dll is code that is LINKED when you run the .exe Chaos: basically, yes alrighty remember that you need the .dll in the same directory as your exe when you run it so it can DYNAMICALLY LINK the code which slide are we on? 21 still? yes "dll" Dynamically linked library so if you'll notice in the .cpp file i gave you in HW0 Zino: good connection :) there is a WinMain() function and that's the entry point of our app however, i set it up so that the effective entry point for us will be int Main(ITCC *itcc) b/c windows programming is kind of tough for beginners :) got that right the ITCC *itcc will be explained later it is scary just write it in there ok good i'll just memorize the bjarne book WinProgramming = tedious; so itcc->InitWindowed will put a window on the screen with client area 640x480 the client area is the region of a window you can draw on i also have a InitFullScreen function that will be given out with HW1 wait a second i'm confused with what? why is itcc a pointer to ITCC the ITCC *itcc will be explained later he said he will explain that l8er oh god right, that's when we get into pointers i'd say :) ohhh i didn't see that so much text in here i miss things just make sure you call these functions using "itcc->" in front of them and you're good itcc->Clear() clears the window to black shhhh let me the guy speak itcc->Text displays text on the screen at position 0,0 so how does a graphics window work? where is (0,0)? anyone? i mean let the guy speak* top left right middle top left middle? hey psy, i got a question :( what is the difference between using -> and . to access the stuff khehtra: i though it would be bottom left think of it as quadrant 4 in the Cartesian system, except y INCREASES going down -> is for pointer i was thinking cartesian quardants or something liek it yeah, we'll get into that later i'm sure he'll go over that later cool yep later for now we need to just write that :) sort of like << in cout :) 320,240 would be the middle right i forgot, is . the scope resolution operator? so for a graphics window, (0,0) is upper left and (649, 479) is lower right so y is up-down, and it increases going down and x is left-right, increasing going right You mean 639, 479 ah yes good catch wez: hold off on those quesions kinda like the way you read a book OOOoooo lol wez, feel free to email me some questions :) We need a really long QA session at the end :-) now here's the tricky part the while loop not really that tricky ;) this is a loop that will always repeat the Clear and Text command :) over and over and over slide #? lol well someone asked what the difference between -> and . is, and i couldn't remember forever (21) well, not forever thx but until you exit the app so what's actually happening is that you see the text on the screen, but 30 times a second, the screen is actually being cleared and redrawn! whoa is that not inefficient? why not just print it to the screen? it is inefficient i didn't compile this, so i never saw what the output was it is a tutorial it isn't supposed to be efficient he is just using for demostration :) this is a begining for fps? just using one thing right now? it's a good way to explain a while loop though i suppose but if you're a game, it's a lot easier to clear the screen 30 times a second if your graphics card can handle it Because it could change later most games will do it this way simply because they can ok redrawing the screen that quickly is enough to fool the eyes into seeing motion Wolf: you can make an FPS out of it eventually :) like flipping cards really fast? right and *** Signoff: Kaize (Quit: PJIRC forever!) the reason you don't see it change is simple ooo the screen is only updated when you call the itcc->Flip() command so what is actually happening is when you clear the screen and draw text, you're not doing it on the monitor you're doing it on a secret drawing board then when that Flip() command is called buffer ok (back buffer) yah you're really quickly flipping that drawing board/buffer onto the monitor yes, this secret drawing board is called the "back buffer" what is buffer overrun... i think i heard that before brb coke that when u mess up on a cdrw when the buffer is overrun lol Chaos: when you write to memory that is beyond that which you allocated or something lol lol oh, so that is like screwing up in an array or something ok so that's the layman speech on how graphics work :) lol Very cool (google for buffer overrun) like overflowing that wa slayman a variable *was jesus so its like a playing card? you have a front and back, and you flip it to see each side? ok lol exactly Flip() returns a value ... and if that value equals, NULL our program is finished so we exit the loop think of != being "not equals" it's kinda like flipping pages, only you are flipping back and forth between them gotcha got it = and == really drove me nuts in the beginning i understand it now there are actually several ways to render graphics/flip pages/copy buffers, but we'll get into that later probably = == equals assignment whatever The Flip() command should return NULL if the user presses the Close button = assign to, == equals to so that will exit the while loop and you'll return 0 (exit normally) what if you return 1? would that affect the program ur screwed 1 would return an error? or is it -1? if some of you want to go, please feel free at any time, i'm just going to keep going though, sorry for going so long so far :) it wont build, i tryed that once lol wez: nothing would generally happen if you return 1 alright what does 1 mean? i dont get it hehe its already 12 at night here you usually send that value back to the Operating System so would it just freeze and the OS decides what to do with it (usually nothing) 1 means on, 0 means off, so what does a -1 value equal? i read a tutorial about -1 i dunno Chaos: you're thinking of binary code :) nevermind! lol yes, i'm off Chaos: you can return any number lol ok (Slide 24) i'm going to get through the if statement then probably stop for questions ok if you can and perhaps you can look into the rest on your own please do else don't if statemnts rule ok, very simply, this is an easy statement to understand: lol chaos... if (KEYDOWN(VK_UP)) we're saying "If the UP key is pressed, then ..." up key right VK stands for Virtual Key is that the same when using Direct X? yes alright in fact, VK_UP is the same in Windows programming if you look up VK_UP, it's in one of the Windows SDK files I saw someone use an array to hold key presses or something so u could like use it to move a pixel across the screen Chaos: right, that's one way to do it bigmano: yep i didn't understand it though :-P just light basically lol ok so if i the UP key is pressed, then i'm going to display "Up key down!" on the screen otherwise, i'm going to skip the code in the braces so if the statement in the parentheses IS TRUE, then i'm going to execute what's in the braces what slide are we on, i got cought up in talking (24) thanks think of it like this: or you could refresh the display zooming in giving the perception of walking forwards in a FPS? IF the statement is true, THEN execute what's in the braces Ari: yes if you want to cool :) Chaos: does that make sense? yes it does :) KEYDOWN(VK_UP) will return TRUE if the key is pressed and FALSE if it isn't so the if statement decides whether TRUE is inside the parentheses Psy: how much longer do you think we will be talking today? i'm going to stop after the if statement is the code constantly checking the key? oh dang ok cool Ari: yes, IF you put it inside that while loop! in the while statement *** Signoff: wezman2k (Quit: ( www.nnscript.de :: NoNameScript 3.81 :: www.XLhost.de )) that's the key ok put it in the braces under the while statement so ... if (1) ... is this valid? yes. how could you make it change the values of x and y for like the hello text ;) yes 1 is true well i'm out guys, i have already done the if statement before in many languages, but anyways this class thing is a great idea yep, it turns out to the C compiler, 0 is FALSE and any other number is TRUE by Elfs :) thanks is the homework posted? so if (0) is not valid? Elfs: not yet, probably tonight ok well cya l8er well if(0) would never execute HW0++ well actually bigops: we'll be talking about changing numbers next lecture i take that back Alrighty folks, I'm off but I'll see you all soon. Thanks Psy. It was great! ok thanks :) L8R *** Signoff: Elfs1der (Quit: ) when we are done can someone save to a text file so I can review what i lost? yes, i'll post my log *** Signoff: Zinoviev (Quit: PJIRC forever!) ok hey psy, do you happen to have any instant messaging programs that we can get in touch with you ok, one more slide or should we do it by e-amil e-mail* Chaos: i'd prefer email alright i'm going to get through slide 25 then stop (25) ok finally, we can use the 'else' command after an 'if' block *** Signoff: rlui (Quit: PJIRC forever!) that is saying IF the up key is down then display something, ELSE display something else so you will execute one branch of code or IN ALL OTHER CIRCUMSTANCES the second branch so this is sort of an if/else statement is what it's called if all this is in the infinite (until exit) while loop, doesnt that mean we have to put all of our code within the while loop otherwise nothing else will get executed? Ari: that's correct ok thx so good question if you have an if statement and else if statements if none of those are true, the else statement would be executed? i'll post an if statement example in with HW1 :) that's right! ^_^ 'else if's can be used such as ... IF the first is true, then executre this, ELSE, IF this is true do this, ELSE do this so you can chain them on forever just remember that if comes first, 'else if's in the middle, and else at the end if you have a while loop in a differant file that you only want to run for alittle while is there a way to make it stop without having to restart the program? isnt it more efficent to use switch instead of a ton of ifs that's a little confusing, so post on the board if you have other questions switch statements can only be used in certain situations i beleive Goply: yes ok Goply: that's more advanced though bigman: switch statements are only more efficient if you know how to use them correctly :) ok goply you can use the while to only go untill something is met, like while x > 5 and once x goes below 5 it will stop heh ok for instance ,the values you're testing should be contiguous ok i think i'm done for now :) ! ok question sweet sorry that i wasn't able to use voice this time wow, that was alot for one day while (itcc->Flip() != NULL) it's okay yes m? you can just use while (itcc->Flip()) right? im sorta confused on alor of parts but im still good I think mine is up now, a little late, it was a browser issue to change the public/private feature that's right m Are you going to go over set pixels next lesson? m smart thanks for the lecture psy, i'm looking forward to the next one later *** Signoff: reversEnginer (Quit: PJIRC forever!) thanks thanks psy, nice chattin 2 u all MrDeadDoll: i actually think i'm going to see if you guys can get that for the homework by Ari ok cool i hope these slides are enough to explain it nite ^_^ the slides are awesome you see, SetPixel is sort of an added feature *** Signoff: Ari (Quit: ) it isn't a C++ concept or anything it's just to play around with oh ok hey psy is there a way once this gets going on schedule that someone could record these voice and text for those of us who can't stay up late, and we can do them the next day? SetPixel is a DX thing? so did everyone get there hello graPHICS to work? in fact, i hope you all can write your own SetPixel later on or Win API thing what are setpixels? ok that would be cool WolfSpring: we'll be recording the voice and posting them using more then one at a time? Chaos: SetPixel is a YOU thing :) Chaos: what i mean is, you'll be writing the SetPixel function later in this course thank you, it's stupid I gotta get up at 4 am during the week to inspect soldiers rooms :( will we be covering any opengl? or just dx3d ah WolfSpring: i agree :P so it is a fuction you make, to easily set the pixel stuff like color Goply: a pixel is the smallest displayable element on your screen ... the function SetPixel will light a single dot on your screen can someone test my TS server see if it's public now? 69.68.177.4 sure m: we will not be covering OGL or DX Wolf not working Error! :P error GDalwdfjkal;wefjwoepfuia m: we will be writing directly to our video cards ourselves error I'm bout to give up Err :o!!! will we cover windows programming? writitng directly to the video cards psy any books u recommended hmmm so.. do you recommend sharpie? or some pen for writing on the video card? or chaos Wolf: i get an error lol bigmano: no windows progamming, sorry :P lol ok This class assumes a lot of prior programming knowledge, we havn't even gone over variables uet bigmano: windows stuff is kind of complicated imo windows stuff is VERY complicated IMO sargos: i don't think it requires any prior knowledge I use C# for that stuff yea imo too i dont know jack and im doing ok sargos: you shouldn't understand how any of these programs work at all yet :) i dont get everything, but im alright O thnks god Psy lol *phew* m: sharpies will work i'm always interested in the "WHY" question in programming khetra: please see the thread on books in the forums is there a way to use more then one pixel at a time? like placing (0,0) to (30,47) green and (31,48) to (50,70) red, without having to do them 1 by 1? i believe you would use while loops could you use a while loop to set the pixels Goply: yes, but we'll get into that next week ok i cant wait till next week me too me eather =) that's where it gets really fun :P lol actually you should have a lot of fun with the homework i believe But i'm looking forward to the pointers and classes parts the most cool cool well imma email u if i still have probs with Hello Graphics imma head out to eat Niteee THnks!!!!! for the lesson sargos: do you feel the pace is too fast? you really shouldn't understand much about these functions yet cya khehtra thanks khehtra, bye yea this was great cant wait to get started on the hw im out roffle every book starts out with sort of some motivating programs, and you just have to jump in imo sargos, i think, that a lot about programming, isn't about knowing how to do something, it is knowing how to figure out how to do something i'll post the hw tonight i hope The pace isn't really too fast... just like.... jumping around. We go from simple topics to way too advanced back to common sense things to advanced first time i have heard that *** Signoff: bigmano5 (Quit: Leaving) can't wait to get hw!! sargos: ok, i'll tone it down for the next lecture, i just wanted to show everyone some simple programs yes, i want homework *you will never see me say this in school* lol :) i'm serious =) i feel the same way so its ok that i didn't understand half the things wez was talking about right? lol MrDeadDoll, i think if i was back learning, i'd probably not understand that much he was talking about MrDeadDoll: yes, you should understand a lot more after HW1 imo hey MrDeadDoll, i added you to my Yahoo Messenger, if you want, we can talk later i added you about 2 or 3 days ago ok sweet haven't seen you come online though knowing is half the battle yeah i always forget to turn it on, i'll start though sorry thought that fit yahoo = teh sux they blocked trillian :| if anyone wants to add me to there friends list ChaosCommand@charter.net for msn messenger, CYI2004 for AIM, jjva99 for yahoo Alright, im gonna go make sense of all these notes I was writing. Thanks Psy, you rule! Adios all cya *** Signoff: MrDeadDoll (Quit: PJIRC forever!) ur my new fwend! hey Psy, are you going to go into For and Do While loops i never use them, but i was wondering if they are usefull YES im Goply@qwest.net on msn messenger for = best while = bester Chaos: yes, they are VERY useful, we'll go over them next week or the week after alright, cool for/while are of equal importance ok everyone, please feel free to chat some more, but i need to get this homework uploaded ... thanks a lot for coming! alright thanks for teaching us psy you are the greatest can't wait for that homework * m slaps ChaosCommand * And Psy gets a..... 5 out of 5 * snap out of it HOMEWORK!!!!!!!! thank you psyklic we thank you WE WANT HOMEWORK :) ... x-play? cant wait for the homework yah hehe x-play!!!! i heard that voice when i read that yup although i wish TechTV and G4 didn't merge i liked TechTV by itself :/ now The Screen Savers are loosing patrick norton i hated that one nerdy guy hopefully he got run over Leo Laporte he was the greatest where do you live Keven Rose, i have talked to him before Virginia whatever happened to thebroken =[ afk for a bit... thebroken.org ? correct. i dunno, only been there a few times The only shows I watch on G4, are The Screen Savers, X-Play, and .... well, that's it i like Robot Wars, but now it is repetitive i don't watch tv and omg it's another fly in my room me either really geez it really distracts me :( ESPN and G4 are the only channels i watch i know i hate flys Hey guys a I got to go LAter especially when it is quiet seeya adios *** Signoff: Dimitris (Quit: PJIRC forever!) hey m, do you got any instant messaging programs? msg: the_mole7@hotmail.com aim: asespirit5 icq: 127756101 *** Wolf (~WolfSprin@diboo-15D0F03.net1268.nc.sprint-hsd.net) has joined channel #itcc and gamesurge irc. :) is ICQ any good? eh i had it a looooooong time ago :/ i have no friends on it dang locked up, ok think i got it i was passing old TS server ip through router one more try for me: 69.68.177.4 *** Signoff: WolfSpring (Ping timeout) yay it works! pword? none works hmmm mic isn't working how do i talk? heh bout damn time, i feel stupid, all about two stuff you goto settings and set upa key or talk into mic your quiet wolf sound sick :| how do i talk?!? >:( i don't even see the option now... he sounds like an alien. voicebox. dude no settings i have 'sound devices' tab yeah i have settings but no input/ouput *** Signoff: EugeneF (Quit: ) oh, that. :) ok right two codecs no settings to talk *** Signoff: khehtra (Quit: ) yeah now with all my reseting my router i've lost all irc chat stuff :( it's late :/ how did you get it get mic to work? settings input/output :) push to talk soo quiet goply wolf do you have a headset? yeah :/ lots of background shizzle noise it works best hey psyklic if you guys need me to host TS next time I think i can hold a few dozen people -zzz- \name *** Signoff: Sargos (Quit: PJIRC forever!) *** Signoff: lucars83 (Quit: ) monday 6am i beleave hey psy is the homework still gonna be due on monday? xpakratx *** Signoff: Goply (Quit: ) seeya wolf *** Wolf has left #itcc I want homework! :) Wolf: thanks, we'll see whether we need help ... would tuesday give you enough time? i don't want to delay things too much Session Close (#itcc): Fri Jul 02 00:37:37 2004