comparison dw.hpp @ 2950:0577a97fe36d

Added dw_pixmap_get_width() and dw_pixmap_get_height() by request for language bindings. These APIs function identical to the already existing DW_PIXMAP_HEIGHT/WIDTH() macros. The macros will exist at least until the end of the 3.x series, at which point they may be retired.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 03 Jan 2023 22:23:08 +0000
parents edb4307ac7ce
children cde59690d3dd
comparison
equal deleted inserted replaced
2949:a1d0522d7edf 2950:0577a97fe36d
922 pwidth = width; pheight = height; 922 pwidth = width; pheight = height;
923 hpmprot = false; 923 hpmprot = false;
924 } 924 }
925 Pixmap(Render *window, const char *filename) { 925 Pixmap(Render *window, const char *filename) {
926 SetHPIXMAP(dw_pixmap_new_from_file(window ? window->GetHWND() : DW_NOHWND, filename)); 926 SetHPIXMAP(dw_pixmap_new_from_file(window ? window->GetHWND() : DW_NOHWND, filename));
927 pwidth = hpixmap ? DW_PIXMAP_WIDTH(hpixmap) : 0; 927 pwidth = dw_pixmap_get_width(hpixmap);
928 pheight = hpixmap ? DW_PIXMAP_HEIGHT(hpixmap) : 0; 928 pheight = dw_pixmap_get_height(hpixmap);
929 hpmprot = false; 929 hpmprot = false;
930 } 930 }
931 Pixmap(HPIXMAP hpm) { 931 Pixmap(HPIXMAP hpm) {
932 SetHPIXMAP(hpm); 932 SetHPIXMAP(hpm);
933 pwidth = hpixmap ? DW_PIXMAP_WIDTH(hpixmap) : 0; 933 pwidth = dw_pixmap_get_width(hpixmap);
934 pheight = hpixmap ? DW_PIXMAP_HEIGHT(hpixmap) : 0; 934 pheight = dw_pixmap_get_height(hpixmap);
935 hpmprot = true; 935 hpmprot = true;
936 } 936 }
937 // Destructor 937 // Destructor
938 ~Pixmap() { if(hpmprot == false) dw_pixmap_destroy(hpixmap); hpixmap = 0; } 938 ~Pixmap() { if(hpmprot == false) dw_pixmap_destroy(hpixmap); hpixmap = 0; }
939 939