Intro. to Game Programming Want to program a game?

Slides:



Advertisements
Similar presentations
Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
Advertisements

 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 1 – Introduction to Computers and C++ Programming Outline 1.6 Machine Languages, Assembly Languages,
COSC 120 Computer Programming
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
Chapter 6 In introduction to System Software and Virtual Machine ***Assembly Language.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Three types of computer languages
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Assembler Compiler Interpreter ASSEMBLER To convert the assembly language into machine code. Translate mnemonic operation codes to their machine language.
Programming is instructing a computer to perform a task for you with the help of a programming language.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
COMPUTER SCIENCE I C++ INTRODUCTION
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Introduction to C++ - How C++ Evolved Most popular languages currently: COBOL, Fortran, C, C++, Java (script) C was developed in 1970s at AT&T (Richie)
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
1Object-Oriented Program Development Using C++ Computer Science and Programming Languages Computers are ubiquitous Computer literacy is essential Computer.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Hello World 2 What does all that mean?.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Computer Engineering 1 nd Semester Dr. Rabie A. Ramadan 2.
Programming With C.
Chapter 1 Introduction to Computers and C++ Programming Goals: To introduce the fundamental hardware and software components of a computer system To introduce.
COMPUTER PROGRAMMING. A Typical C++ Environment Phases of C++ Programs: 1- Edit 2- Preprocess 3- Compile 4- Link 5- Load 6- Execute Loader Primary Memory.
INTRODUCTION Kingdom of Saudi Arabia Princess Nora bint Abdul Rahman University College of Computer Since and Information System CS240.
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
1 C++ Programming Basics Chapter 1 Lecture CSIS 10A.
Chapter 0 Getting Started. Objectives Understand the basic structure of a C++ program including: – Comments – Preprocessor instructions – Main function.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 05, 2005 Lecture Number: 4.
Hardware and Software Programming. COMP104 Lecture 2 / Slide 2 Hardware and Software l Why should we bother with hardware, while we are having a programming.
CS Class 03 Topics  Sequence statements Input Output Assignment  Expressions Read pages Read pages 40 – 49 for next time.
CS Computer Science I. BCPL was developed in 1967 as a language for writing operating systems and software compilers In 1970, the creators of the.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
CHAPTER 1: INTRODUCTION C++ Programming. CS 241 Course URL: Text Book: C++ How to Program, DETITEL & DEITEL, eighth Edition.
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
C is a high level language (HLL)
1 Structure of Simple C++ Program Chapter 1 09/09/13.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Software Engineering Algorithms, Compilers, & Lifecycle.
By Kundang K Juman Hardware & Software. COMP102 Prog. Fundamentals I: Software / Slide 2 l Four components of a computer system: n CPU - central processing.
STRUCTURED PROGRAMMING Complete C++ Program. Content 2  Main Function  Preprocessor directives  User comments  Escape characters  cout statement.
Chapter 1: An Overview of Computers and Programming Languages
Computer Terms Review from what language did C++ originate?
Engineering Problem Solving With C An Object Based Approach
Chapter 1: Introduction to computers and C++ Programming
Operating System Interface between a user and the computer hardware
Computer Programming Lecturer: Ir Dr Frank H.F. LEUNG
Choice of Programming Language
Computer Software CS 107 Lecture 2 September 1, :53 PM.
Hello World 2 What does all that mean?.
Hardware & Software Programming. COMP102 Prog. Fundamentals I: Software / Slide 2 l Four components of a computer system: n CPU - central processing unit.
Programs written in C and C++ can run on many different computers
Computer Terms Review from what language did C++ originate?
COMS 261 Computer Science I
Week 5 Computers are like Old Testament gods; lots of rules and no mercy. Joseph Campbell.
Presentation transcript:

Intro. to Game Programming Want to program a game?

Very Important Points Classroom etiquette Lab etiquette Problems with – Teacher – Course content – Evaluation – Programming for labs – Personal

Basics Game Consoles and mobile devices Hardware, Software and Firmware 1’s and 0’s Assembly Language HLL (High Level Language)

Game Consoles and Mobile All game machines share their internals with regular computer architecture All game machines have – Input – Output – Processing

Hardware, Software & Firmware Hardware refers to a PHYSICAL DEVICE Software refers to INFORMATION that commands a device Firmware refers to EMBEDDED Software – fixed INSIDE a device

Processing Game consoles have microprocessors that understand and perform operations based on a PATTERN of 1’s and 0’s

1’s and 0’s Can be COMMANDS (or INSTRUCTIONS) to a device Can be DATA for use by a device Determination of interpretation depends on the CONTEXT of the 1s and 0s

Machine Code Jumping to the address 1024: [ op | target address ] decimal binary

Assembly Code MOV r0, #0C ;load base address of string into r0 LOAD: MOV r1,(r0) ;load contents into r1 CALL PRINT ; call a print routine to print the character in r1 INC r0 ;point to next character JMP LOAD ;load next character ALMOST ENGLISH

High Level Language Early HLL – Fortran – Cobol Basic Pascal C (from B) Jumping to the address 1024: C++ Java

Why C++? Industry Standard 70% of Game Developers use this language on a DAILY basis Object-oriented Practical outside of game development in industry

How do we make a program? Compile Link Load

COMPILE Command Line cc -c file.c GUI (Graphical User Interface) Go to menu option… Build and select Compile

COMPILE (More) Compiling takes English-like language and creates instructions that the computer can follow. Calls to other code will be links and need to be resolved in order to build REAL executable 1’s and 0’s

LINK and LOAD Command Line ln file1.o file2.o GUI (Graphical User Interface) Go to menu option… Build and select BUILD

LINK and LOAD (More) All calls to other code are resolved into actual locations where the code is now residing. Programmers use libraries that contain many commonly requested functions. These are resolved in the LINK and LOAD process as well The LOAD process refers to the first part of executing (or running) the program on a computer.

Hello World in C++ #include using namespace std; int main() { cout << “Hello World" << endl; return 0; }

Hello World in C++ #include Preprocessor command – starts with ‘#’ Processed BEFORE actual compile Effect of including an entire file inside your file

Hello World in C++ using namespace std; Declares where to assume you are “using” functions “std” means STANDARD and allows a command like “cout” to be understood

Hello World in C++ int main() { } A function called “main” which returns an “int” value “main” MUST be in all C++ programs “{“ “}” delimit the function (indicate what is inside the function)

Hello World in C++ cout << “Hello World" << endl; “cout” is an object that is connected to our terminal screen by default “Hello World” is sent to the object for display on the screen “endl” is a “manipulator” that adds a CR LF (Carriage Return and Line Feed)

Compiling Hello World in C++ Save the contents of the program into a file called “hello.cpp” Run the following command c++ -o hello hello.cpp The PROGRAM is created… linking and loading is ALSO performed (by default)

Running the Hello World Program In a Unix/MacOS/Linux environment./hello In Windows… the program MUST be named with “.exe” on the end hello.exe