hdc = (wxDC*)hdc_;
}
-void SurfaceImpl::InitPixMap(int width, int height, Surface *WXUNUSED(surface_), WindowID) {
+void SurfaceImpl::InitPixMap(int width, int height, Surface *WXUNUSED(surface_), WindowID winid) {
Release();
hdc = new wxMemoryDC();
hdcOwned = true;
if (width < 1) width = 1;
if (height < 1) height = 1;
- bitmap = new wxBitmap(width, height);
+ bitmap = new wxBitmap();
+ bitmap->CreateScaled(width, height,wxBITMAP_SCREEN_DEPTH,((wxWindow*)winid)->GetContentScaleFactor());
((wxMemoryDC*)hdc)->SelectObject(*bitmap);
}
void SurfaceImpl::Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back) {
PenColour(fore);
BrushColour(back);
- hdc->DrawPolygon(npts, (wxPoint*)pts);
+ wxPoint *p = new wxPoint[npts];
+
+ for (int i=0; i<npts; i++) {
+ p[i].x = pts[i].x;
+ p[i].y = pts[i].y;
+ }
+ hdc->DrawPolygon(npts, p);
+ delete [] p;
}
void SurfaceImpl::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) {
const char *Platform::DefaultFont() {
static char buf[128];
- strcpy(buf, wxNORMAL_FONT->GetFaceName().mbc_str());
+ wxStrlcpy(buf, wxNORMAL_FONT->GetFaceName().mbc_str(), WXSIZEOF(buf));
return buf;
}