The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Functions
rect.hpp File Reference

Contains the SDL_Rect helper code. More...

#include <SDL_version.h>
#include "utils.hpp"
#include <SDL_rect.h>
Include dependency graph for rect.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 sdl
 

Functions

SDL_Rect sdl::create_rect (const int x, const int y, const int w, const int h)
 Creates an empty SDL_Rect. More...
 
bool sdl::point_in_rect (int x, int y, const SDL_Rect &rect)
 Tests whether a point is inside a rectangle. More...
 
bool sdl::rects_overlap (const SDL_Rect &rect1, const SDL_Rect &rect2)
 Tests whether two rectangles overlap. More...
 
SDL_Rect sdl::intersect_rects (SDL_Rect const &rect1, SDL_Rect const &rect2)
 Calculates the intersection of two rectangles. More...
 
SDL_Rect sdl::union_rects (const SDL_Rect &rect1, const SDL_Rect &rect2)
 Calculates the union of two rectangles. More...
 
void sdl::fill_rect_alpha (SDL_Rect &rect, Uint32 color, Uint8 alpha, surface target)
 Fills a specified area of a surface with a given color and opacity. More...
 
void sdl::draw_rectangle (int x, int y, int w, int h, Uint32 color, surface tg)
 Draw a colored rectangle on a surface. More...
 
void sdl::draw_solid_tinted_rectangle (int x, int y, int w, int h, int r, int g, int b, double alpha, surface target)
 Fills a specified rectangle area of a surface with a given color and opacity. More...
 
void sdl::fill_rect (surface &dst, SDL_Rect *dst_rect, const Uint32 color)
 Fill a rectangle on a given surface. More...
 
bool operator== (const SDL_Rect &a, const SDL_Rect &b)
 
bool operator!= (const SDL_Rect &a, const SDL_Rect &b)
 

Detailed Description

Contains the SDL_Rect helper code.

Definition in file rect.hpp.

Function Documentation

bool operator!= ( const SDL_Rect &  a,
const SDL_Rect &  b 
)

Definition at line 167 of file rect.cpp.

References operator==().

bool operator== ( const SDL_Rect &  a,
const SDL_Rect &  b 
)

Definition at line 162 of file rect.cpp.

Referenced by operator!=().