Revision: 75320
http://sourceforge.net/p/brlcad/code/75320
Author: starseeker
Date: 2020-04-09 15:41:07 +0000 (Thu, 09 Apr 2020)
Log Message:
-----------
Rough in a way to get the hdc (untested)
Modified Paths:
--------------
brlcad/trunk/include/dm.h
brlcad/trunk/src/libdm/dm-generic.c
brlcad/trunk/src/libtclcad/dm_tcl.c
Modified: brlcad/trunk/include/dm.h
===================================================================
--- brlcad/trunk/include/dm.h 2020-04-09 15:31:34 UTC (rev 75319)
+++ brlcad/trunk/include/dm.h 2020-04-09 15:41:07 UTC (rev 75320)
@@ -464,6 +464,7 @@
DM_EXPORT extern void dm_flush(dm *dmp);
DM_EXPORT extern void *dm_os_window(dm *dmp);
+DM_EXPORT extern void *dm_device_context(dm *dmp);
DM_EXPORT extern int dm_png_write(dm *dmp, FILE *fp, struct bu_vls *msgs);
Modified: brlcad/trunk/src/libdm/dm-generic.c
===================================================================
--- brlcad/trunk/src/libdm/dm-generic.c 2020-04-09 15:31:34 UTC (rev 75319)
+++ brlcad/trunk/src/libdm/dm-generic.c 2020-04-09 15:41:07 UTC (rev 75320)
@@ -226,7 +226,17 @@
return NULL;
}
+void *
+dm_device_context(dm *dmp)
+{
+ if (UNLIKELY(!dmp)) return NULL;
+#if defined(IF_WGL)
+ return (void *)&(((struct dm_xvars *)dmp->dm_vars.pub_vars)->hdc);
+#endif
+ return NULL;
+}
+
fastf_t
dm_Xx2Normal(dm *dmp, int x)
{
Modified: brlcad/trunk/src/libtclcad/dm_tcl.c
===================================================================
--- brlcad/trunk/src/libtclcad/dm_tcl.c 2020-04-09 15:31:34 UTC (rev 75319)
+++ brlcad/trunk/src/libtclcad/dm_tcl.c 2020-04-09 15:41:07 UTC (rev 75320)
@@ -2790,10 +2790,10 @@
want the out-of-date visual - for now, do two swaps. If there's some
way to trigger a Window re-draw without doing buffer swaps, that would
be preferable... */
- SwapBuffers(((struct dm_xvars *)dmp->dm_vars.pub_vars)->hdc);
- SwapBuffers(((struct dm_xvars *)dmp->dm_vars.pub_vars)->hdc);
+ SwapBuffers((HDC)dm_device_context(dmp));
+ SwapBuffers((HDC)dm_device_context(dmp));
#endif
-}
+}
/* Tk_CreateEventHandler */
static void
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits