diff 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
line wrap: on
line diff
--- a/dw.hpp	Mon Jan 02 21:41:27 2023 +0000
+++ b/dw.hpp	Tue Jan 03 22:23:08 2023 +0000
@@ -924,14 +924,14 @@
     }
     Pixmap(Render *window, const char *filename) { 
         SetHPIXMAP(dw_pixmap_new_from_file(window ? window->GetHWND() : DW_NOHWND, filename));
-        pwidth = hpixmap ? DW_PIXMAP_WIDTH(hpixmap) : 0;
-        pheight = hpixmap ? DW_PIXMAP_HEIGHT(hpixmap) : 0;
+        pwidth = dw_pixmap_get_width(hpixmap);
+        pheight = dw_pixmap_get_height(hpixmap);
         hpmprot = false;
     }
     Pixmap(HPIXMAP hpm) { 
         SetHPIXMAP(hpm);
-        pwidth = hpixmap ? DW_PIXMAP_WIDTH(hpixmap) : 0;
-        pheight = hpixmap ? DW_PIXMAP_HEIGHT(hpixmap) : 0;
+        pwidth = dw_pixmap_get_width(hpixmap);
+        pheight = dw_pixmap_get_height(hpixmap);
         hpmprot = true;
     }
     // Destructor