#include <cvideo.h>
Inheritance diagram for CSurface:


Public Member Functions | |
| CSurface (int w, int h) | |
| CSurface (const char *filename) | |
| CSurface (CSurface ©) | |
| ~CSurface () | |
| CSurface & | operator= (CSurface &cs) |
| void | set_transparent_color (CColor color) |
| void | blit (CSurface &source) |
| void | blit (CSurface &source, CPoint &dest_pos) |
| void | blit (CSurface &source, CPoint &dest_pos, CRect &src_rect) |
| void | fill_rect (const CRect &rect, CColor color) |
| void | set_clipping_rect (CRect &rect) |
| void | clear_clipping_rect () |
| int | get_depth () |
| int | get_width () |
| int | get_height () |
| CPoint | get_size () |
Protected Member Functions | |
| void | attach (CSurface &cs) |
| void | detach () |
Protected Attributes | |
| CSurfaceImpl * | impl |
Being the interface end of a bridge pattern, it makes sense that this class should be used as a higher-level abstraction for the implementation; currently, the only thing "higher-level" about this is the garbage collection used by the attach/detach methods, but other higher-level abstractions could be added later.
Note also that since this class has no virtual methods, it literally only contains the pointer of the CSurfaceImpl it points to; as such, it's extremely portable. When assigning to/from a CSurface, use value assignment instead of reference assignment, as this will use the overloaded '=' operator and change the reference counts of the surfaces involved, making sure that the physical surfaces get deleted when they need to. It will also make your code less vulnerable to dangling pointers.
Definition at line 310 of file cvideo.h.
|
||||||||||||
|
Create a new surface with the given width and height. This method actually just calls the make_csurface_impl() factory method on the CVideoSystem singleton to get its CSurfaceImpl object. Definition at line 340 of file cvideo.h. References CSingletonManager< CVideoSystem >::get_instance(), impl, and CVideoSystem::make_csurface_impl(). |
Here is the call graph for this function:

|
|
Create a new surface from the given graphics filename (usually a Windows BMP file). This method actually just calls the make_csurface_impl() factory method on the CVideoSystem singleton to get its CSurfaceImpl object. Definition at line 346 of file cvideo.h. References CSingletonManager< CVideoSystem >::get_instance(), impl, and CVideoSystem::make_csurface_impl(). |
Here is the call graph for this function:

|
|
The copy constructor. Note that this doesn't actually make a copy of the surface--it just increases the CSurfaceImpl's reference count so it knows there's another CSurface pointing at its physical bitmap. Definition at line 352 of file cvideo.h. References attach(). |
Here is the call graph for this function:

|
|
The destructor. Definition at line 355 of file cvideo.h. References detach(). |
Here is the call graph for this function:

|
|
Attaches this surface to the given surface. Used when a CSurface is assigned to another CSurface, etc... Definition at line 317 of file cvideo.h. References impl, and CSurfaceImpl::inc_ref_count(). |
Here is the call graph for this function:

|
||||||||||||||||
|
Surface-blitting function. See CSurfaceImpl for documentation. Definition at line 378 of file cvideo.h. References CSurfaceImpl::blit(), and impl. |
Here is the call graph for this function:

|
||||||||||||
|
Surface-blitting function. See CSurfaceImpl for documentation. Definition at line 375 of file cvideo.h. References CSurfaceImpl::blit(), and impl. |
Here is the call graph for this function:

|
|
Surface-blitting function. See CSurfaceImpl for documentation. Definition at line 372 of file cvideo.h. References CSurfaceImpl::blit(), and impl. |
Here is the call graph for this function:

|
|
Clear the clipping rectangle for the surface. Definition at line 387 of file cvideo.h. References CSurfaceImpl::clear_clipping_rect(), and impl. |
Here is the call graph for this function:

|
|
Detaches this surface from its implementation (the "real" physical surface). Used when a CSurface is destroyed or assigned to a different surface than the one it's already assigned to, etc... Definition at line 325 of file cvideo.h. References CSurfaceImpl::dec_ref_count(), impl, and CSurfaceImpl::is_empty(). |
Here is the call graph for this function:

|
||||||||||||
|
Draw a filled rectangle on the surface. Definition at line 381 of file cvideo.h. References CSurfaceImpl::fill_rect(), and impl. |
Here is the call graph for this function:

|
|
See CSurfaceImpl documentation. Definition at line 390 of file cvideo.h. References CSurfaceImpl::get_depth(), and impl. |
Here is the call graph for this function:

|
|
See CSurfaceImpl documentation. Definition at line 396 of file cvideo.h. References CSurfaceImpl::get_height(), and impl. |
Here is the call graph for this function:

|
|
Convenience method that returns the size of the surface as a CPoint where the x coordinate is the width and the y coordinate is the height of the surface. Definition at line 401 of file cvideo.h. References get_height(), and get_width(). |
Here is the call graph for this function:

|
|
See CSurfaceImpl documentation. Definition at line 393 of file cvideo.h. References CSurfaceImpl::get_width(), and impl. |
Here is the call graph for this function:

|
|
Overloaded '=' operator. Detaches from the current CSurfaceImpl being pointed to, and attaches to the new one, changing reference counts as appropriate. |
Here is the call graph for this function:

|
|
Set the clipping rectangle for the surface. Definition at line 384 of file cvideo.h. References impl, and CSurfaceImpl::set_clipping_rect(). |
Here is the call graph for this function:

|
|
Set the transparent color of the surface. Definition at line 369 of file cvideo.h. References impl, and CSurfaceImpl::set_transparent_color(). |
Here is the call graph for this function:

|
|
Our implementation. |
1.3.3