Difference between revisions of "Intermediate C++ Game Programming Tutorial 10"

From Chilipedia
Jump to: navigation, search
(Video Timestamp Index)
Line 6: Line 6:
 
* Calculating padding
 
* Calculating padding
 
* Drawing sprites (pixel blocks) from a <code>Surface</code> to the screen
 
* Drawing sprites (pixel blocks) from a <code>Surface</code> to the screen
 +
 +
== Notes ==
 +
We definitely should be checking for self assignment (<code>mySurf = mySurf;</code>) in the assignment operator for <code>Surface</code>. See [[this page|Intermediate C++ Game Programming Tutorial 6#Errata]] for more details.
  
 
== Video Timestamp Index ==
 
== Video Timestamp Index ==

Revision as of 19:28, 22 September 2017

The promised day has come. We're finally going to be loading images from bitmap files into memory and drawing them as sprites on the screen. This is where all that stuff we've been learning--data types, pointers, memory management, file access, etc.--is going to pay off bigtime. Also, get fukt massive PutPixel sprite functions; die in a garbage fire.

Topics Covered

  • Surface class for storing image data in memory
  • Parsing Windows bitmap file headers and loading pixel data
  • Calculating padding
  • Drawing sprites (pixel blocks) from a Surface to the screen

Notes

We definitely should be checking for self assignment (mySurf = mySurf;) in the assignment operator for Surface. See Intermediate C++ Game Programming Tutorial 6#Errata for more details.

Video Timestamp Index

Tutorial 10

Source Code

Sprite Repo

Download Materials

Homework

The homework is to improve the bitmap loading routine to support 32-bit RGB format and to support bitmaps with reverse row order.

See also