36#include "../../utility/PError.h"
37#include "../../base/PComplexData.h"
94 out <<
"<SDL PlatformWidget> " << std::flush;
109 long unsigned int newWidth =
mWidth;
110 long unsigned int newHeight =
mHeight;
120 std::list<PWidget *>::iterator p =
mSubWidgets.end();
128 if((*p)->IsVisible())
141 long unsigned int w =
mWidth;
151 SDL_Rect fromRect = {0,0,(int)w,(
int)h};
154 if(std::abs(
mZoomX-1.0)>.001 || std::abs(
mZoomY-1.0)>.001 )
192 SDL_Rect toRect = {
static_cast<int>(
mDrawX),
205 result = SDL_SetRenderTarget(
mRenderer,parenttexture);
209 cerr <<
" SetRenderTarget failed with error code: " << result << endl;
211 cerr <<
"SDL message: " << SDL_GetError() << endl;
212 cerr << *
this << endl;
213 cerr <<
"Parent:" << parenttexture << endl;
219 while(result<0 &
count++<10)
228 cerr <<
"SDL_RenderCopyEx failed with error code: " << result <<
"|" <<
count<< endl;
229 cerr <<
"SDL message: " << SDL_GetError() << endl;
230 cerr << *
this << endl;
231 cerr <<
"Texture:" <<
mTexture << endl;
240 cerr <<
"Resetting SDL_SetRenderTarget failed with error code: " << result << endl;
241 cerr <<
"SDL message: " << SDL_GetError() << endl;
242 cerr << *
this << endl;
243 cerr <<
"Texture:" <<
mTexture << endl;
250 SDL_SetTextureBlendMode(
mTexture, SDL_BLENDMODE_BLEND);
257 cerr <<
"Rendering failed to NULL texture using SDL_RenderCopyEx with error code: " << result << endl;
258 cerr <<
"SDL message: " << SDL_GetError() << endl;
259 cerr << *
this << endl;
260 cerr <<
"Texture:" <<
mTexture << endl;
315 SDL_Surface * tmp = rotozoomSurfaceXY(
mSurface, angle,zoomx, zoomy, smooth);
334SDL_Surface * PlatformWidget::GetSDL_Surface()
388 std::list<PWidget*>::iterator i =
mSubWidgets.begin();
409 if(strcmp(child->
ObjectName().c_str(),
"PlatformMovie")==0)
462 std::list<PWidget*>::iterator i =
mSubWidgets.begin();
489void PlatformWidget::SetParentSurface(SDL_Surface* surface)
491 mParentSurface = surface;
495void PlatformWidget::SetParentTexture(SDL_Texture* texture)
497 mParentTexture = texture;
508 std::list<PWidget*>::const_iterator i =
mSubWidgets.begin();
538 cerr <<
"Need to lock surface but can't\n";
void SignalFatalError(const std::string &message)
void DrawPixel(SDL_Renderer *renderer, PlatformWidget *pwidget, int x, int y, PColor color)
This sets a pixel to be a certain color.
PColor GetPixelColor(SDL_Surface *surface, int x, int y)
This extracts the color of a pixel.