Revision: 75435
http://sourceforge.net/p/brlcad/code/75435
Author: starseeker
Date: 2020-04-17 15:06:54 +0000 (Fri, 17 Apr 2020)
Log Message:
-----------
Start shifting to using backend specific versions of dm_xvars.h
Modified Paths:
--------------
brlcad/branches/dm-fb-merge/src/libdm/X/dm-X.c
brlcad/branches/dm-fb-merge/src/libdm/X/dm-X.h
brlcad/branches/dm-fb-merge/src/libdm/dm-generic.c
brlcad/branches/dm-fb-merge/src/libdm/glx/dm-ogl.c
brlcad/branches/dm-fb-merge/src/libdm/glx/dm-ogl.h
brlcad/branches/dm-fb-merge/src/libdm/osgl/dm-osgl.cpp
brlcad/branches/dm-fb-merge/src/libdm/osgl/osg_bob.cpp
brlcad/branches/dm-fb-merge/src/libdm/qt/dm-qt.cpp
brlcad/branches/dm-fb-merge/src/libdm/tk/dm-tk.c
brlcad/branches/dm-fb-merge/src/libdm/wgl/dm-wgl.c
brlcad/branches/dm-fb-merge/src/libdm/wgl/dm-wgl.h
brlcad/branches/dm-fb-merge/src/mged/dm-generic.c
Modified: brlcad/branches/dm-fb-merge/src/libdm/X/dm-X.c
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/X/dm-X.c 2020-04-17 14:16:09 UTC
(rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/X/dm-X.c 2020-04-17 15:06:54 UTC
(rev 75435)
@@ -59,11 +59,9 @@
#include "bu/endian.h"
#include "bn.h"
#include "dm.h"
-#include "./dm-X.h"
#include "../null/dm-Null.h"
-#include "../include/dm_xvars.h"
-#include "dm.h"
#include "./fb_X.h"
+#include "./dm-X.h"
#include "rt/solid.h"
@@ -163,7 +161,7 @@
XWindowAttributes xwa;
XFontStruct *newfontstruct;
XGCValues gcv;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
XGetWindowAttributes(pubvars->dpy,
@@ -289,11 +287,11 @@
int min_depth = 8;
int *good = NULL;
int screen;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
vibase = XGetVisualInfo(pubvars->dpy, 0, &vitemp, &num);
- screen = DefaultScreen(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->dpy);
+ screen = DefaultScreen(((struct dm_Xvars *)dmp->i->dm_vars.pub_vars)->dpy);
good = (int *)bu_malloc(sizeof(int)*num, "alloc good visuals");
@@ -378,7 +376,7 @@
HIDDEN int
X_close(struct dm *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
if (pubvars->dpy) {
@@ -408,7 +406,7 @@
bu_vls_free(&dmp->i->dm_tkName);
bu_vls_free(&dmp->i->dm_dName);
bu_free((void *)dmp->i->dm_vars.priv_vars, "X_close: x_vars");
- bu_free((void *)dmp->i->dm_vars.pub_vars, "X_close: dm_xvars");
+ bu_free((void *)dmp->i->dm_vars.pub_vars, "X_close: dm_Xvars");
bu_free((void *)dmp->i, "X_close: dmp->i");
bu_free((void *)dmp, "X_close: dmp");
@@ -443,7 +441,7 @@
Tk_Window tkwin = (Tk_Window)NULL;
Screen *screen = (Screen *)NULL;
- struct dm_xvars *pubvars = NULL;
+ struct dm_Xvars *pubvars = NULL;
struct x_vars *privars = NULL;
#ifdef HAVE_TK
@@ -459,8 +457,8 @@
dmp->i = dmpi;
dmp->i->dm_interp = interp;
- BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_xvars);
- pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_Xvars);
+ pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
BU_ALLOC(dmp->i->dm_vars.priv_vars, struct x_vars);
privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
@@ -769,7 +767,7 @@
X_drawBegin(struct dm *dmp)
{
XGCValues gcv;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel)
@@ -799,7 +797,7 @@
HIDDEN int
X_drawEnd(struct dm *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel)
@@ -862,7 +860,7 @@
fastf_t pointSize = DM_X_DEFAULT_POINT_SIZE;
static int nvectors = 0;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
/* delta is used in clipping to insure clipped endpoint is
@@ -1201,7 +1199,7 @@
X_drawString2D(struct dm *dmp, const char *str, fastf_t x, fastf_t y, int
size, int use_aspect)
{
int sx, sy;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel) {
@@ -1232,7 +1230,7 @@
X_drawLine2D(struct dm *dmp, fastf_t x_1, fastf_t y_1, fastf_t x_2, fastf_t
y_2)
{
int sx1, sy1, sx2, sy2;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
sx1 = dm_Normal2Xx(dmp, x_1);
@@ -1278,7 +1276,7 @@
X_drawPoint2D(struct dm *dmp, fastf_t x, fastf_t y)
{
int sx, sy;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
sx = dm_Normal2Xx(dmp, x);
@@ -1302,7 +1300,7 @@
X_setFGColor(struct dm *dmp, unsigned char r, unsigned char g, unsigned char
b, int strict, fastf_t transparency)
{
XGCValues gcv;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel)
@@ -1343,7 +1341,7 @@
HIDDEN int
X_setBGColor(struct dm *dmp, unsigned char r, unsigned char g, unsigned char b)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel)
@@ -1379,7 +1377,7 @@
X_setLineAttr(struct dm *dmp, int width, int style)
{
int linestyle;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel)
@@ -1491,8 +1489,8 @@
int blue_bits;
- ximage_p = XGetImage(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->dpy,
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->win,
+ ximage_p = XGetImage(((struct dm_Xvars *)dmp->i->dm_vars.pub_vars)->dpy,
+ ((struct dm_Xvars *)dmp->i->dm_vars.pub_vars)->win,
0, 0,
dmp->i->dm_width,
dmp->i->dm_height,
@@ -1690,7 +1688,7 @@
{
struct fb_platform_specific *fb_ps;
struct X24_fb_info *xfb_ps;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_Xvars *pubvars = (struct dm_Xvars *)dmp->i->dm_vars.pub_vars;
struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
fb_ps = fb_get_platform_specific(FB_X24_MAGIC);
@@ -1715,6 +1713,8 @@
{"", 0, (char *)0, 0,
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL}
};
+#define XVARS_MV_O(_m) offsetof(struct dm_Xvars, _m)
+
struct bu_structparse dm_Xvars_vparse[] = {
{"%x", 1, "dpy", XVARS_MV_O(dpy),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%x", 1, "win", XVARS_MV_O(win),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
Modified: brlcad/branches/dm-fb-merge/src/libdm/X/dm-X.h
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/X/dm-X.h 2020-04-17 14:16:09 UTC
(rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/X/dm-X.h 2020-04-17 15:06:54 UTC
(rev 75435)
@@ -28,7 +28,12 @@
#include "common.h"
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include "tk.h"
+#define HAVE_X11_TYPES 1
+
#define CMAP_BASE 40
#define CUBE_DIMENSION 6
#define NUM_PIXELS 216 /* CUBE_DIMENSION * CUBE_DIMENSION * CUBE_DIMENSION
*/
@@ -49,6 +54,20 @@
fastf_t ppmm_y; /* pixel per mm in y */
};
+struct dm_Xvars {
+ Display *dpy;
+ Window win;
+ Tk_Window top;
+ Tk_Window xtkwin;
+ int depth;
+ Colormap cmap;
+ XVisualInfo *vip;
+ XFontStruct *fontstruct;
+ int devmotionnotify;
+ int devbuttonpress;
+ int devbuttonrelease;
+};
+
#endif /* DM_X_H */
/** @} */
/*
Modified: brlcad/branches/dm-fb-merge/src/libdm/dm-generic.c
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/dm-generic.c 2020-04-17 14:16:09 UTC
(rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/dm-generic.c 2020-04-17 15:06:54 UTC
(rev 75435)
@@ -188,51 +188,18 @@
}
}
-/* TODO - these aren't truly generic, which suggest they need callbacks, but
- * put them here for now since it's better than what we were doing (exposing
- * dm_xvars.h as public API...) */
-
void
-#if (defined HAVE_TK)
dm_geometry_request(struct dm *dmp, int width, int height)
-#else
-dm_geometry_request(struct dm *dmp, int UNUSED(width), int UNUSED(height))
-#endif
{
- if (!dmp) return;
-#if (defined HAVE_TK)
- Tk_GeometryRequest(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin,
width, height);
-#endif
+ if (!dmp || !dmp->i->dm_geometry_request) return;
+ (void)dmp->i->dm_geometry_request(dmp, width, height);
}
-struct bu_structparse dm_xvars_vparse[] = {
- {"%x", 1, "dpy", XVARS_MV_O(dpy),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%x", 1, "win", XVARS_MV_O(win),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%x", 1, "top", XVARS_MV_O(top),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%x", 1, "tkwin", XVARS_MV_O(xtkwin),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%d", 1, "depth", XVARS_MV_O(depth),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%x", 1, "cmap", XVARS_MV_O(cmap),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
-#if defined(DM_X) || defined (DM_OGL) || defined (DM_WGL)
- {"%x", 1, "vip", XVARS_MV_O(vip),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%x", 1, "fontstruct", XVARS_MV_O(fontstruct),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
-#endif
- {"%d", 1, "devmotionnotify", XVARS_MV_O(devmotionnotify),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%d", 1, "devbuttonpress", XVARS_MV_O(devbuttonpress),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%d", 1, "devbuttonrelease", XVARS_MV_O(devbuttonrelease),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"", 0, (char *)0, 0,
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
-};
-
void
dm_internal_var(struct bu_vls *result, struct dm *dmp, const char *key)
{
- if (!dmp || !result) return;
- if (!key) {
- // Print all current vars
- bu_vls_struct_print2(result, "dm internal X variables",
dm_xvars_vparse, (const char *)dmp->i->dm_vars.pub_vars);
- return;
- }
- // Print specific var
- bu_vls_struct_item_named(result, dm_xvars_vparse, key, (const char
*)dmp->i->dm_vars.pub_vars, ',');
+ if (!dmp || !result || !dmp->i->dm_internal_var) return;
+ (void)dmp->i->dm_internal_var(result, dmp, key);
}
/* Properly generic function */
Modified: brlcad/branches/dm-fb-merge/src/libdm/glx/dm-ogl.c
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/glx/dm-ogl.c 2020-04-17 14:16:09 UTC
(rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/glx/dm-ogl.c 2020-04-17 15:06:54 UTC
(rev 75435)
@@ -78,7 +78,7 @@
#include "rt/solid.h"
#include "dm.h"
#include "../null/dm-Null.h"
-#include "../include/dm_xvars.h"
+//#include "./dm-glx.h"
#include "./fb_ogl.h"
#include "./dm-ogl.h"
@@ -186,7 +186,7 @@
ogl_setBGColor(struct dm *dmp, unsigned char r, unsigned char g, unsigned char
b)
{
struct modifiable_ogl_vars *mvars = (struct modifiable_ogl_vars
*)dmp->i->m_vars;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_glxvars *pubvars = (struct dm_glxvars *)dmp->i->dm_vars.pub_vars;
struct ogl_vars *privars = (struct ogl_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel == 1)
bu_log("ogl_setBGColor()\n");
@@ -226,7 +226,7 @@
XWindowAttributes xwa;
XFontStruct *newfontstruct;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_glxvars *pubvars = (struct dm_glxvars *)dmp->i->dm_vars.pub_vars;
struct ogl_vars *privars = (struct ogl_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel)
@@ -399,7 +399,7 @@
HIDDEN int
ogl_makeCurrent(struct dm *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_glxvars *pubvars = (struct dm_glxvars *)dmp->i->dm_vars.pub_vars;
struct ogl_vars *privars = (struct ogl_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel)
@@ -419,7 +419,7 @@
HIDDEN int
ogl_configureWin(struct dm *dmp, int force)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_glxvars *pubvars = (struct dm_glxvars *)dmp->i->dm_vars.pub_vars;
struct ogl_vars *privars = (struct ogl_vars *)dmp->i->dm_vars.priv_vars;
if (!glXMakeCurrent(pubvars->dpy,
@@ -475,7 +475,7 @@
HIDDEN XVisualInfo *
ogl_choose_visual(struct dm *dmp, Tk_Window tkwin)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_glxvars *pubvars = (struct dm_glxvars *)dmp->i->dm_vars.pub_vars;
struct modifiable_ogl_vars *mvars = (struct modifiable_ogl_vars
*)dmp->i->m_vars;
XVisualInfo *vip, vitemp, *vibase, *maxvip;
int tries, baddepth;
@@ -620,7 +620,7 @@
HIDDEN int
ogl_close(struct dm *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_glxvars *pubvars = (struct dm_glxvars *)dmp->i->dm_vars.pub_vars;
struct ogl_vars *privars = (struct ogl_vars *)dmp->i->dm_vars.priv_vars;
if (pubvars->dpy) {
@@ -642,7 +642,7 @@
bu_vls_free(&dmp->i->dm_tkName);
bu_vls_free(&dmp->i->dm_dName);
bu_free(dmp->i->dm_vars.priv_vars, "ogl_close: ogl_vars");
- bu_free(dmp->i->dm_vars.pub_vars, "ogl_close: dm_xvars");
+ bu_free(dmp->i->dm_vars.pub_vars, "ogl_close: dm_glxvars");
BU_PUT(dmp->i, struct dm_impl);
BU_PUT(dmp, struct dm);
@@ -682,7 +682,7 @@
Tk_Window tkwin = (Tk_Window)NULL;
int screen_number = -1;
- struct dm_xvars *pubvars = NULL;
+ struct dm_glxvars *pubvars = NULL;
struct ogl_vars *privvars = NULL;
if ((tkwin = Tk_MainWindow(interp)) == NULL) {
@@ -701,12 +701,12 @@
dmp->i->dm_bits_per_channel = 8;
bu_vls_init(&(dmp->i->dm_log));
- BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_xvars);
+ BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_glxvars);
if (dmp->i->dm_vars.pub_vars == (void *)NULL) {
bu_free(dmp, "ogl_open: dmp");
return DM_NULL;
}
- pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ pubvars = (struct dm_glxvars *)dmp->i->dm_vars.pub_vars;
BU_ALLOC(dmp->i->dm_vars.priv_vars, struct ogl_vars);
if (dmp->i->dm_vars.priv_vars == (void *)NULL) {
@@ -1039,8 +1039,8 @@
old_glxContext = privars->glxc;
if ((privars->glxc =
- glXCreateContext(((struct dm_xvars
*)dmp1->i->dm_vars.pub_vars)->dpy,
- ((struct dm_xvars
*)dmp1->i->dm_vars.pub_vars)->vip,
+ glXCreateContext(((struct dm_glxvars
*)dmp1->i->dm_vars.pub_vars)->dpy,
+ ((struct dm_glxvars
*)dmp1->i->dm_vars.pub_vars)->vip,
(GLXContext)NULL, GL_TRUE))==NULL) {
bu_log("ogl_share_dlist: couldn't create glXContext.\nUsing old
context\n.");
privars->glxc = old_glxContext;
@@ -1048,8 +1048,8 @@
return BRLCAD_ERROR;
}
- if (!glXMakeCurrent(((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->dpy,
- ((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->win,
+ if (!glXMakeCurrent(((struct dm_glxvars
*)dmp1->i->dm_vars.pub_vars)->dpy,
+ ((struct dm_glxvars
*)dmp1->i->dm_vars.pub_vars)->win,
privars->glxc)) {
bu_log("ogl_share_dlist: Couldn't make context current\nUsing old
context\n.");
privars->glxc = old_glxContext;
@@ -1077,7 +1077,7 @@
glDrawBuffer(GL_FRONT);
/* this is important so that ogl_configureWin knows to set the font */
- ((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->fontstruct = NULL;
+ ((struct dm_glxvars *)dmp1->i->dm_vars.pub_vars)->fontstruct = NULL;
/* do viewport, ortho commands and initialize font */
(void)ogl_configureWin_guts(dmp1, 1);
@@ -1110,8 +1110,8 @@
privars->face_flag = 1; /* faceplate matrix is on top of stack */
/* destroy old context */
- glXMakeCurrent(((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->dpy,
None, NULL);
- glXDestroyContext(((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->dpy,
old_glxContext);
+ glXMakeCurrent(((struct dm_glxvars *)dmp1->i->dm_vars.pub_vars)->dpy,
None, NULL);
+ glXDestroyContext(((struct dm_glxvars
*)dmp1->i->dm_vars.pub_vars)->dpy, old_glxContext);
} else {
/* dmp1 will share its display lists with dmp2 */
@@ -1118,8 +1118,8 @@
old_glxContext = ((struct ogl_vars *)dmp2->i->dm_vars.priv_vars)->glxc;
if ((((struct ogl_vars *)dmp2->i->dm_vars.priv_vars)->glxc =
- glXCreateContext(((struct dm_xvars
*)dmp2->i->dm_vars.pub_vars)->dpy,
- ((struct dm_xvars
*)dmp2->i->dm_vars.pub_vars)->vip,
+ glXCreateContext(((struct dm_glxvars
*)dmp2->i->dm_vars.pub_vars)->dpy,
+ ((struct dm_glxvars
*)dmp2->i->dm_vars.pub_vars)->vip,
privars->glxc,
GL_TRUE))==NULL) {
bu_log("ogl_share_dlist: couldn't create glXContext.\nUsing old
context\n.");
@@ -1128,8 +1128,8 @@
return BRLCAD_ERROR;
}
- if (!glXMakeCurrent(((struct dm_xvars *)dmp2->i->dm_vars.pub_vars)->dpy,
- ((struct dm_xvars *)dmp2->i->dm_vars.pub_vars)->win,
+ if (!glXMakeCurrent(((struct dm_glxvars
*)dmp2->i->dm_vars.pub_vars)->dpy,
+ ((struct dm_glxvars
*)dmp2->i->dm_vars.pub_vars)->win,
((struct ogl_vars
*)dmp2->i->dm_vars.priv_vars)->glxc)) {
bu_log("ogl_share_dlist: Couldn't make context current\nUsing old
context\n.");
((struct ogl_vars *)dmp2->i->dm_vars.priv_vars)->glxc =
old_glxContext;
@@ -1179,8 +1179,8 @@
((struct ogl_vars *)dmp2->i->dm_vars.priv_vars)->face_flag = 1; /*
faceplate matrix is on top of stack */
/* destroy old context */
- glXMakeCurrent(((struct dm_xvars *)dmp2->i->dm_vars.pub_vars)->dpy,
None, NULL);
- glXDestroyContext(((struct dm_xvars *)dmp2->i->dm_vars.pub_vars)->dpy,
old_glxContext);
+ glXMakeCurrent(((struct dm_glxvars *)dmp2->i->dm_vars.pub_vars)->dpy,
None, NULL);
+ glXDestroyContext(((struct dm_glxvars
*)dmp2->i->dm_vars.pub_vars)->dpy, old_glxContext);
}
return BRLCAD_OK;
@@ -1193,7 +1193,7 @@
HIDDEN int
ogl_drawBegin(struct dm *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_glxvars *pubvars = (struct dm_glxvars *)dmp->i->dm_vars.pub_vars;
struct modifiable_ogl_vars *mvars = (struct modifiable_ogl_vars
*)dmp->i->m_vars;
struct ogl_vars *privars = (struct ogl_vars *)dmp->i->dm_vars.priv_vars;
@@ -1282,7 +1282,7 @@
HIDDEN int
ogl_drawEnd(struct dm *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_glxvars *pubvars = (struct dm_glxvars *)dmp->i->dm_vars.pub_vars;
struct modifiable_ogl_vars *mvars = (struct modifiable_ogl_vars
*)dmp->i->m_vars;
struct ogl_vars *privars = (struct ogl_vars *)dmp->i->dm_vars.priv_vars;
@@ -2358,7 +2358,7 @@
struct fb_platform_specific *fb_ps;
struct ogl_fb_info *ofb_ps;
struct modifiable_ogl_vars *mvars = (struct modifiable_ogl_vars
*)dmp->i->m_vars;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_glxvars *pubvars = (struct dm_glxvars *)dmp->i->dm_vars.pub_vars;
struct ogl_vars *privars = (struct ogl_vars *)dmp->i->dm_vars.priv_vars;
fb_ps = fb_get_platform_specific(FB_OGL_MAGIC);
Modified: brlcad/branches/dm-fb-merge/src/libdm/glx/dm-ogl.h
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/glx/dm-ogl.h 2020-04-17 14:16:09 UTC
(rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/glx/dm-ogl.h 2020-04-17 15:06:54 UTC
(rev 75435)
@@ -28,6 +28,9 @@
#include "common.h"
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
#ifdef HAVE_GL_GLX_H
# include <GL/glx.h>
#endif
@@ -35,6 +38,9 @@
# include <GL/gl.h>
#endif
+#include "tk.h"
+#define HAVE_X11_TYPES 1
+
#include "bu/vls.h"
#define CMAP_BASE 40
Modified: brlcad/branches/dm-fb-merge/src/libdm/osgl/dm-osgl.cpp
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/osgl/dm-osgl.cpp 2020-04-17
14:16:09 UTC (rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/osgl/dm-osgl.cpp 2020-04-17
15:06:54 UTC (rev 75435)
@@ -53,13 +53,12 @@
#include "raytrace.h"
#include "dm.h"
#include "dm-Null.h"
-#include "./dm_xvars.h"
#include "dm.h"
#include "rt/solid.h"
#include "./private.h"
#include "./fb_osgl.h"
-#include "dm-osgl.h"
+#include "./dm-osgl.h"
/* For Tk, we need to offset when thinking about screen size in
* order to allow for the Mac OSX top-of-screen toolbar - Tk
@@ -197,7 +196,7 @@
{
int width = 0;
int height = 0;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_osglvars *pubvars = (struct dm_osglvars
*)dmp->i->dm_vars.pub_vars;
#if !defined(_WIN32)
int bl = Tk_InternalBorderLeft(Tk_Parent(pubvars->xtkwin));
int bt = Tk_InternalBorderTop(Tk_Parent(pubvars->xtkwin));
@@ -361,9 +360,9 @@
((struct osgl_vars
*)dmp->i->dm_vars.priv_vars)->graphicsContext->releaseContext();
- if (((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin) {
- Tk_DeleteEventHandler(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->xtkwin, VisibilityChangeMask, OSGEventProc,
(ClientData)dmp);
- Tk_DestroyWindow(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin);
+ if (((struct dm_osglvars *)dmp->i->dm_vars.pub_vars)->xtkwin) {
+ Tk_DeleteEventHandler(((struct dm_osglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin, VisibilityChangeMask, OSGEventProc,
(ClientData)dmp);
+ Tk_DestroyWindow(((struct dm_osglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin);
}
bu_vls_free(&dmp->i->dm_pathName);
@@ -370,7 +369,7 @@
bu_vls_free(&dmp->i->dm_tkName);
bu_vls_free(&dmp->i->dm_dName);
bu_free(dmp->i->dm_vars.priv_vars, "osgl_close: osgl_vars");
- bu_free(dmp->i->dm_vars.pub_vars, "osgl_close: dm_xvars");
+ bu_free(dmp->i->dm_vars.pub_vars, "osgl_close: dm_osglvars");
bu_free(dmp, "osgl_close: dmp");
return TCL_OK;
@@ -393,7 +392,7 @@
Tk_Window tkwin = (Tk_Window)NULL;
Tcl_Interp *interp = (Tcl_Interp *)vinterp;
- struct dm_xvars *pubvars = NULL;
+ struct dm_osglvars *pubvars = NULL;
struct osgl_vars *privvars = NULL;
if ((tkwin = Tk_MainWindow(interp)) == NULL) {
@@ -410,12 +409,12 @@
dmp->i->dm_bits_per_channel = 8;
bu_vls_init(&(dmp->i->dm_log));
- BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_xvars);
+ BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_osglvars);
if (dmp->i->dm_vars.pub_vars == (void *)NULL) {
bu_free(dmp, "osgl_open: dmp");
return DM_NULL;
}
- pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ pubvars = (struct dm_osglvars *)dmp->i->dm_vars.pub_vars;
BU_ALLOC(dmp->i->dm_vars.priv_vars, struct osgl_vars);
if (dmp->i->dm_vars.priv_vars == (void *)NULL) {
@@ -598,9 +597,9 @@
// something showing how to handle Cocoa for the Mac, if that's possible
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new
osg::GraphicsContext::Traits;
#if defined(_WIN32)
- osg::ref_ptr<osg::Referenced> windata = new
osgViewer::GraphicsWindowWin32::WindowData(Tk_GetHWND(((struct dm_xvars
*)(dmp->i->dm_vars.pub_vars))->win));
+ osg::ref_ptr<osg::Referenced> windata = new
osgViewer::GraphicsWindowWin32::WindowData(Tk_GetHWND(((struct dm_osglvars
*)(dmp->i->dm_vars.pub_vars))->win));
#else
- osg::ref_ptr<osg::Referenced> windata = new
osgViewer::GraphicsWindowX11::WindowData(((struct dm_xvars
*)(dmp->i->dm_vars.pub_vars))->win);
+ osg::ref_ptr<osg::Referenced> windata = new
osgViewer::GraphicsWindowX11::WindowData(((struct dm_osglvars
*)(dmp->i->dm_vars.pub_vars))->win);
#endif
// Although we are not making direct use of osgViewer currently, we need
its
@@ -726,8 +725,8 @@
old_glxContext = ((struct osgl_vars *)dmp1->i->dm_vars.priv_vars)->glxc;
if ((((struct osgl_vars *)dmp1->i->dm_vars.priv_vars)->glxc =
- glXCreateContext(((struct dm_xvars
*)dmp1->i->dm_vars.pub_vars)->dpy,
- ((struct dm_xvars
*)dmp1->i->dm_vars.pub_vars)->vip,
+ glXCreateContext(((struct dm_osglvars
*)dmp1->i->dm_vars.pub_vars)->dpy,
+ ((struct dm_osglvars
*)dmp1->i->dm_vars.pub_vars)->vip,
(GLXContext)NULL, GL_TRUE))==NULL) {
bu_log("osgl_share_dlist: couldn't create glXContext.\nUsing old
context\n.");
((struct osgl_vars *)dmp1->i->dm_vars.priv_vars)->glxc =
old_glxContext;
@@ -735,8 +734,8 @@
return TCL_ERROR;
}
- if (!glXMakeCurrent(((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->dpy,
- ((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->win,
+ if (!glXMakeCurrent(((struct dm_osglvars
*)dmp1->i->dm_vars.pub_vars)->dpy,
+ ((struct dm_osglvars
*)dmp1->i->dm_vars.pub_vars)->win,
((struct osgl_vars
*)dmp1->i->dm_vars.priv_vars)->glxc)) {
bu_log("osgl_share_dlist: Couldn't make context current\nUsing old
context\n.");
((struct osgl_vars *)dmp1->i->dm_vars.priv_vars)->glxc =
old_glxContext;
@@ -764,7 +763,7 @@
glDrawBuffer(GL_FRONT);
/* this is important so that osgl_configureWin knows to set the font */
- ((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->fontstruct = NULL;
+ ((struct dm_osglvars *)dmp1->i->dm_vars.pub_vars)->fontstruct = NULL;
/* do viewport, ortho commands and initialize font */
(void)osgl_configureWin_guts(dmp1, 1);
@@ -797,8 +796,8 @@
((struct osgl_vars *)dmp1->i->dm_vars.priv_vars)->face_flag = 1; /*
faceplate matrix is on top of stack */
/* destroy old context */
- glXMakeCurrent(((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->dpy,
None, NULL);
- glXDestroyContext(((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->dpy,
old_glxContext);
+ glXMakeCurrent(((struct dm_osglvars *)dmp1->i->dm_vars.pub_vars)->dpy,
None, NULL);
+ glXDestroyContext(((struct dm_osglvars
*)dmp1->i->dm_vars.pub_vars)->dpy, old_glxContext);
} else {
/* dmp1 will share its display lists with dmp2 */
@@ -805,8 +804,8 @@
old_glxContext = ((struct osgl_vars *)dmp2->i->dm_vars.priv_vars)->glxc;
if ((((struct osgl_vars *)dmp2->i->dm_vars.priv_vars)->glxc =
- glXCreateContext(((struct dm_xvars
*)dmp2->i->dm_vars.pub_vars)->dpy,
- ((struct dm_xvars
*)dmp2->i->dm_vars.pub_vars)->vip,
+ glXCreateContext(((struct dm_osglvars
*)dmp2->i->dm_vars.pub_vars)->dpy,
+ ((struct dm_osglvars
*)dmp2->i->dm_vars.pub_vars)->vip,
((struct osgl_vars
*)dmp1->i->dm_vars.priv_vars)->glxc,
GL_TRUE))==NULL) {
bu_log("osgl_share_dlist: couldn't create glXContext.\nUsing old
context\n.");
@@ -815,8 +814,8 @@
return TCL_ERROR;
}
- if (!glXMakeCurrent(((struct dm_xvars *)dmp2->i->dm_vars.pub_vars)->dpy,
- ((struct dm_xvars *)dmp2->i->dm_vars.pub_vars)->win,
+ if (!glXMakeCurrent(((struct dm_osglvars
*)dmp2->i->dm_vars.pub_vars)->dpy,
+ ((struct dm_osglvars
*)dmp2->i->dm_vars.pub_vars)->win,
((struct osgl_vars
*)dmp2->i->dm_vars.priv_vars)->glxc)) {
bu_log("osgl_share_dlist: Couldn't make context current\nUsing old
context\n.");
((struct osgl_vars *)dmp2->i->dm_vars.priv_vars)->glxc =
old_glxContext;
@@ -866,8 +865,8 @@
((struct osgl_vars *)dmp2->i->dm_vars.priv_vars)->face_flag = 1; /*
faceplate matrix is on top of stack */
/* destroy old context */
- glXMakeCurrent(((struct dm_xvars *)dmp2->i->dm_vars.pub_vars)->dpy,
None, NULL);
- glXDestroyContext(((struct dm_xvars *)dmp2->i->dm_vars.pub_vars)->dpy,
old_glxContext);
+ glXMakeCurrent(((struct dm_osglvars *)dmp2->i->dm_vars.pub_vars)->dpy,
None, NULL);
+ glXDestroyContext(((struct dm_osglvars
*)dmp2->i->dm_vars.pub_vars)->dpy, old_glxContext);
}
#endif
return TCL_OK;
@@ -2257,7 +2256,7 @@
struct fb_platform_specific *fb_ps;
struct osgl_fb_info *ofb_ps;
struct modifiable_osgl_vars *mvars = (struct modifiable_osgl_vars
*)dmp->i->m_vars;
- /*struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;*/
+ /*struct dm_osglvars *pubvars = (struct dm_osglvars
*)dmp->i->dm_vars.pub_vars;*/
struct osgl_vars *privars = (struct osgl_vars *)dmp->i->dm_vars.priv_vars;
fb_ps = fb_get_platform_specific(FB_OSGL_MAGIC);
Modified: brlcad/branches/dm-fb-merge/src/libdm/osgl/osg_bob.cpp
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/osgl/osg_bob.cpp 2020-04-17
14:16:09 UTC (rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/osgl/osg_bob.cpp 2020-04-17
15:06:54 UTC (rev 75435)
@@ -32,8 +32,8 @@
#include "tk.h"
#include "rt/solid.h"
#include "dm.h"
-#include "dm_xvars.h"
-#include "dm-ogl.h"
+#include "dm-osgl.h"
+#include "../glx/dm-ogl.h"
#include <assert.h>
#if 1
@@ -343,7 +343,7 @@
assert(dmp);
assert(!dmp->dm_osgData);
- win = ((struct dm_xvars *)(dmp->dm_vars.pub_vars))->win;
+ win = ((struct dm_osglvars *)(dmp->dm_vars.pub_vars))->win;
//create our graphics context directly so we can pass our own window
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new
osg::GraphicsContext::Traits;
Modified: brlcad/branches/dm-fb-merge/src/libdm/qt/dm-qt.cpp
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/qt/dm-qt.cpp 2020-04-17 14:16:09 UTC
(rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/qt/dm-qt.cpp 2020-04-17 15:06:54 UTC
(rev 75435)
@@ -29,8 +29,6 @@
# include <sys/time.h>
#endif
-#include "dm-qt.h"
-
#include "tcl.h"
#include "tk.h"
#include "bu/log.h"
@@ -38,9 +36,9 @@
#include "bu/parse.h"
#include "dm.h"
#include "private.h"
-#include "./dm_xvars.h"
#include "dm-Null.h"
#include "./fb_qt.h"
+#include "./dm-qt.h"
#define DM_QT_DEFAULT_POINT_SIZE 1.0
@@ -63,7 +61,7 @@
HIDDEN int
qt_close(struct dm *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_qtvars *pubvars = (struct dm_qtvars *)dmp->i->dm_vars.pub_vars;
struct qt_vars *privars = (struct qt_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel) {
@@ -83,7 +81,7 @@
bu_vls_free(&dmp->i->dm_tkName);
bu_vls_free(&dmp->i->dm_dName);
bu_free((void *)dmp->i->dm_vars.priv_vars, "qt_close: qt_vars");
- bu_free((void *)dmp->i->dm_vars.pub_vars, "qt_close: dm_xvars");
+ bu_free((void *)dmp->i->dm_vars.pub_vars, "qt_close: dm_qtvars");
bu_free((void *)dmp, "qt_close: dmp");
return TCL_OK;
@@ -574,7 +572,7 @@
HIDDEN int
qt_configureWin(struct dm *dmp, int force)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_qtvars *pubvars = (struct dm_qtvars *)dmp->i->dm_vars.pub_vars;
struct qt_vars *privars = (struct qt_vars *)dmp->i->dm_vars.priv_vars;
int width = Tk_Width(pubvars->xtkwin);
@@ -783,7 +781,7 @@
struct bu_vls str = BU_VLS_INIT_ZERO;
Tk_Window tkwin;
- struct dm_xvars *pubvars = NULL;
+ struct dm_qtvars *pubvars = NULL;
struct qt_vars *privars = NULL;
if (argc < 0 || !argv) {
@@ -799,8 +797,8 @@
*dmp = dm_qt; /* struct copy */
dmp->i->dm_interp = interp;
- BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_xvars);
- pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_qtvars);
+ pubvars = (struct dm_qtvars *)dmp->i->dm_vars.pub_vars;
BU_ALLOC(dmp->i->dm_vars.priv_vars, struct qt_vars);
privars = (struct qt_vars *)dmp->i->dm_vars.priv_vars;
Modified: brlcad/branches/dm-fb-merge/src/libdm/tk/dm-tk.c
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/tk/dm-tk.c 2020-04-17 14:16:09 UTC
(rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/tk/dm-tk.c 2020-04-17 15:06:54 UTC
(rev 75435)
@@ -61,7 +61,6 @@
#include "dm.h"
#include "./dm-tk.h"
#include "../null/dm-Null.h"
-#include "../include/dm_xvars.h"
#include "../include/private.h"
#include "rt/solid.h"
@@ -81,7 +80,7 @@
HIDDEN int
tk_close(struct dm *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
if (pubvars->dpy) {
@@ -119,7 +118,7 @@
HIDDEN int
tk_drawBegin(struct dm *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
XGCValues gcv;
@@ -154,7 +153,7 @@
HIDDEN int
tk_drawEnd(struct dm *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel)
@@ -169,7 +168,7 @@
/* Prevent lag between events and updates */
- XSync(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->dpy, 0);
+ XSync(((struct dm_tkvars *)dmp->i->dm_vars.pub_vars)->dpy, 0);
return BRLCAD_OK;
}
@@ -223,7 +222,7 @@
fastf_t dist_prev=1.0;
static int nvectors = 0;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel) {
@@ -504,7 +503,7 @@
tk_drawString2D(struct dm *dmp, const char *str, fastf_t x, fastf_t y, int
size, int use_aspect)
{
int sx, sy;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel) {
@@ -540,7 +539,7 @@
HIDDEN int
tk_drawLine2D(struct dm *dmp, fastf_t xpos1, fastf_t ypos1, fastf_t xpos2,
fastf_t ypos2)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
int sx1, sy1, sx2, sy2;
@@ -590,7 +589,7 @@
HIDDEN int
tk_drawPoint2D(struct dm *dmp, fastf_t x, fastf_t y)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
int sx, sy;
@@ -615,7 +614,7 @@
HIDDEN int
tk_setFGColor(struct dm *dmp, unsigned char r, unsigned char g, unsigned char
b, int strict, fastf_t transparency)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
XColor color;
@@ -661,7 +660,7 @@
return BRLCAD_ERROR;
}
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel)
@@ -687,7 +686,7 @@
HIDDEN int
tk_setLineAttr(struct dm *dmp, int width, int style)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
int linestyle;
@@ -756,7 +755,7 @@
int h, w;
Tcl_Interp *interp = (Tcl_Interp *)dmp->i->dm_interp;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
@@ -856,7 +855,7 @@
tk_geometry_request(struct dm *dmp, int width, int height)
{
if (!dmp) return -1;
- Tk_GeometryRequest(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin,
width, height);
+ Tk_GeometryRequest(((struct dm_tkvars *)dmp->i->dm_vars.pub_vars)->xtkwin,
width, height);
return 0;
}
@@ -1013,8 +1012,8 @@
dmp->i = dmp_impl;
dmp->i->dm_interp = interp;
- BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_xvars);
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_tkvars);
+ struct dm_tkvars *pubvars = (struct dm_tkvars *)dmp->i->dm_vars.pub_vars;
BU_ALLOC(dmp->i->dm_vars.priv_vars, struct tk_vars);
struct tk_vars *privars = (struct tk_vars *)dmp->i->dm_vars.priv_vars;
Modified: brlcad/branches/dm-fb-merge/src/libdm/wgl/dm-wgl.c
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/wgl/dm-wgl.c 2020-04-17 14:16:09 UTC
(rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/wgl/dm-wgl.c 2020-04-17 15:06:54 UTC
(rev 75435)
@@ -41,12 +41,10 @@
#include "vmath.h"
#include "bn.h"
+#include "rt/solid.h"
#include "dm.h"
-#include "rt/solid.h"
#include "../null/dm-Null.h"
#include "./dm-wgl.h"
-#include "../include/dm_xvars.h"
-#include "dm.h"
#include "./fb_wgl.h"
#include "../include/private.h"
@@ -180,7 +178,7 @@
((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->b = b / 255.0;
if (mvars->doublebuffer) {
- SwapBuffers(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc);
+ SwapBuffers(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc);
glClearColor(((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->r,
((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->g,
((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->b,
@@ -199,8 +197,8 @@
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->i->dm_vars.pub_vars)->hdc);
- SwapBuffers(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc);
+ SwapBuffers(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc);
+ SwapBuffers(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc);
}
@@ -222,13 +220,13 @@
old_glxContext = ((struct wgl_vars *)dmp1->i->dm_vars.priv_vars)->glxc;
if ((((struct wgl_vars *)dmp1->i->dm_vars.priv_vars)->glxc =
- wglCreateContext(((struct dm_xvars
*)dmp1->i->dm_vars.pub_vars)->hdc))==NULL) {
+ wglCreateContext(((struct dm_wglvars
*)dmp1->i->dm_vars.pub_vars)->hdc))==NULL) {
bu_log("wgl_share_dlist: couldn't create glXContext.\nUsing old
context\n.");
((struct wgl_vars *)dmp1->i->dm_vars.priv_vars)->glxc =
old_glxContext;
return BRLCAD_ERROR;
}
- if (!wglMakeCurrent(((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->hdc,
+ if (!wglMakeCurrent(((struct dm_wglvars
*)dmp1->i->dm_vars.pub_vars)->hdc,
((struct wgl_vars
*)dmp1->i->dm_vars.priv_vars)->glxc)) {
bu_log("wgl_share_dlist: Couldn't make context current\nUsing old
context\n.");
((struct wgl_vars *)dmp1->i->dm_vars.priv_vars)->glxc =
old_glxContext;
@@ -256,7 +254,7 @@
glDrawBuffer(GL_FRONT);
/* this is important so that wgl_configureWin knows to set the font */
- ((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->fontstruct = NULL;
+ ((struct dm_wglvars *)dmp1->i->dm_vars.pub_vars)->fontstruct = NULL;
/* do viewport, ortho commands and initialize font */
(void)wgl_configureWin_guts(dmp1, 1);
@@ -289,7 +287,7 @@
((struct wgl_vars *)dmp1->i->dm_vars.priv_vars)->face_flag = 1; /*
faceplate matrix is on top of stack */
/* destroy old context */
- wglMakeCurrent(((struct dm_xvars *)dmp1->i->dm_vars.pub_vars)->hdc,
+ wglMakeCurrent(((struct dm_wglvars *)dmp1->i->dm_vars.pub_vars)->hdc,
((struct wgl_vars *)dmp1->i->dm_vars.priv_vars)->glxc);
wglDeleteContext(old_glxContext);
} else {
@@ -298,7 +296,7 @@
old_glxContext = ((struct wgl_vars *)dmp2->i->dm_vars.priv_vars)->glxc;
if ((((struct wgl_vars *)dmp2->i->dm_vars.priv_vars)->glxc =
- wglCreateContext(((struct dm_xvars
*)dmp1->i->dm_vars.pub_vars)->hdc))==NULL) {
+ wglCreateContext(((struct dm_wglvars
*)dmp1->i->dm_vars.pub_vars)->hdc))==NULL) {
bu_log("wgl_share_dlist: couldn't create glXContext.\nUsing old
context\n.");
((struct wgl_vars *)dmp2->i->dm_vars.priv_vars)->glxc =
old_glxContext;
@@ -305,7 +303,7 @@
return BRLCAD_ERROR;
}
- if (!wglMakeCurrent(((struct dm_xvars *)dmp2->i->dm_vars.pub_vars)->hdc,
+ if (!wglMakeCurrent(((struct dm_wglvars
*)dmp2->i->dm_vars.pub_vars)->hdc,
((struct wgl_vars
*)dmp2->i->dm_vars.priv_vars)->glxc)) {
bu_log("wgl_share_dlist: Couldn't make context current\nUsing old
context\n.");
((struct wgl_vars *)dmp2->i->dm_vars.priv_vars)->glxc =
old_glxContext;
@@ -355,7 +353,7 @@
((struct wgl_vars *)dmp2->i->dm_vars.priv_vars)->face_flag = 1; /*
faceplate matrix is on top of stack */
/* destroy old context */
- wglMakeCurrent(((struct dm_xvars *)dmp2->i->dm_vars.pub_vars)->hdc,
+ wglMakeCurrent(((struct dm_wglvars *)dmp2->i->dm_vars.pub_vars)->hdc,
((struct wgl_vars *)dmp2->i->dm_vars.priv_vars)->glxc);
wglDeleteContext(old_glxContext);
}
@@ -370,20 +368,20 @@
HIDDEN int
wgl_close(struct dm *dmp)
{
- if (((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->dpy) {
+ if (((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->dpy) {
if (((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->glxc) {
- wglMakeCurrent(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc,
+ wglMakeCurrent(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc,
((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->glxc);
wglDeleteContext(((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->glxc);
}
- if (((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->cmap)
- XFreeColormap(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->dpy,
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->cmap);
+ if (((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->cmap)
+ XFreeColormap(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->dpy,
+ ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->cmap);
- if (((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin) {
- Tk_DeleteEventHandler(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->xtkwin, VisibilityChangeMask, WGLEventProc,
(ClientData)dmp);
- Tk_DestroyWindow(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->xtkwin);
+ if (((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->xtkwin) {
+ Tk_DeleteEventHandler(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin, VisibilityChangeMask, WGLEventProc,
(ClientData)dmp);
+ Tk_DestroyWindow(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin);
}
}
@@ -391,7 +389,7 @@
bu_vls_free(&dmp->i->dm_tkName);
bu_vls_free(&dmp->i->dm_dName);
bu_free(dmp->i->dm_vars.priv_vars, "wgl_close: wgl_vars");
- bu_free(dmp->i->dm_vars.pub_vars, "wgl_close: dm_xvars");
+ bu_free(dmp->i->dm_vars.pub_vars, "wgl_close: dm_wglvars");
bu_free(dmp->i, "wgl_close: dmpi");
bu_free(dmp, "wgl_close: dmp");
@@ -417,7 +415,7 @@
wgl_actively_drawing = 1;
- if (!wglMakeCurrent(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc,
+ if (!wglMakeCurrent(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc,
((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->glxc)) {
LPVOID buf;
@@ -487,7 +485,7 @@
}
if (mvars->doublebuffer) {
- SwapBuffers(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc);
+ SwapBuffers(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc);
if (dmp->i->dm_clearBufferAfter) {
/* give Graphics pipe time to work */
@@ -1263,7 +1261,7 @@
memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
- iPixelFormat = GetPixelFormat(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc);
+ iPixelFormat = GetPixelFormat(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc);
if (iPixelFormat) {
LPVOID buf;
@@ -1292,8 +1290,8 @@
pfd.iLayerType = PFD_MAIN_PLANE;
mvars->zbuf = 1;
- iPixelFormat = ChoosePixelFormat(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, &pfd);
- good = SetPixelFormat(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc,
iPixelFormat, &pfd);
+ iPixelFormat = ChoosePixelFormat(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, &pfd);
+ good = SetPixelFormat(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, iPixelFormat, &pfd);
if (good)
return 1;
@@ -1320,7 +1318,7 @@
if (dmp->i->dm_debugLevel)
bu_log("wgl_configureWin_guts()\n");
- hwnd = WindowFromDC(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc);
+ hwnd = WindowFromDC(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc);
GetWindowRect(hwnd, &xwa);
/* nothing to do */
@@ -1332,7 +1330,7 @@
wgl_reshape(dmp, xwa.right-xwa.left, xwa.bottom-xwa.top);
/* First time through, load a font or quit */
- if (((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct == NULL) {
+ if (((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct == NULL) {
logfont.lfHeight = 18;
logfont.lfWidth = 0;
logfont.lfEscapement = 0;
@@ -1348,11 +1346,11 @@
logfont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
logfont.lfFaceName[0] = (TCHAR)0;
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
CreateFontIndirect(&logfont);
- if (((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct == NULL) {
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
CreateFontIndirect(&logfont);
+ if (((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct ==
NULL) {
/* ????? add backup later */
/* Try hardcoded backup font */
- /* if ((((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct =
+ /* if ((((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct =
(HFONT *)CreateFontIndirect(&logfont)) == NULL) */
{
bu_log("wgl_configureWin_guts: Can't open font '%s' or '%s'\n",
FONT9, FONTBACK);
@@ -1360,17 +1358,17 @@
}
}
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc,
0, 256, ((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->fontOffset);
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc,
0, 256, ((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
/* Always try to choose a the font that best fits the window size.
*/
- if (!GetObject(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct,
sizeof(LOGFONT), &logfont)) {
+ if (!GetObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct, sizeof(LOGFONT), &logfont)) {
logfont.lfHeight = 18;
logfont.lfWidth = 0;
logfont.lfEscapement = 0;
@@ -1386,17 +1384,17 @@
logfont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
logfont.lfFaceName[0] = (TCHAR) 0;
- if ((((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
+ if ((((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
CreateFontIndirect(&logfont)) == NULL) {
bu_log("wgl_configureWin_guts: Can't open font '%s' or '%s'\n",
FONT9, FONTBACK);
return BRLCAD_ERROR;
}
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc,
0, 256, ((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->fontOffset);
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc,
0, 256, ((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
@@ -1406,12 +1404,12 @@
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else {
@@ -1421,12 +1419,12 @@
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 679) {
@@ -1435,12 +1433,12 @@
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 776) {
@@ -1449,10 +1447,10 @@
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 873) {
@@ -1460,12 +1458,12 @@
logfont.lfHeight = 17;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 970) {
@@ -1473,12 +1471,12 @@
logfont.lfHeight = 18;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 1067) {
@@ -1486,12 +1484,12 @@
logfont.lfHeight = 19;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 1164) {
@@ -1499,12 +1497,12 @@
logfont.lfHeight = 20;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 1261) {
@@ -1512,12 +1510,12 @@
logfont.lfHeight = 21;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 1358) {
@@ -1525,12 +1523,12 @@
logfont.lfHeight = 22;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 1455) {
@@ -1538,12 +1536,12 @@
logfont.lfHeight = 23;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 1552) {
@@ -1551,12 +1549,12 @@
logfont.lfHeight = 24;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 1649) {
@@ -1564,12 +1562,12 @@
logfont.lfHeight = 25;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 1746) {
@@ -1577,12 +1575,12 @@
logfont.lfHeight = 26;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 1843) {
@@ -1590,12 +1588,12 @@
logfont.lfHeight = 27;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else if (dmp->i->dm_width < 1940) {
@@ -1603,12 +1601,12 @@
logfont.lfHeight = 28;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
} else {
@@ -1616,12 +1614,12 @@
logfont.lfHeight = 29;
logfont.lfWidth = 0;
if ((newfontstruct = CreateFontIndirect(&logfont)) != NULL) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct =
newfontstruct;
- oldfont = SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
- wglUseFontBitmaps(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct
= newfontstruct;
+ oldfont = SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->fontstruct);
+ wglUseFontBitmaps(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, 0, 256, ((struct wgl_vars
*)dmp->i->dm_vars.priv_vars)->fontOffset);
if (oldfont != NULL)
- DeleteObject(SelectObject(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
+ DeleteObject(SelectObject(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc, oldfont));
}
}
}
@@ -1696,7 +1694,7 @@
if (dmp->i->dm_debugLevel)
bu_log("wgl_makeCurrent()\n");
- if (!wglMakeCurrent(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc,
+ if (!wglMakeCurrent(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc,
((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->glxc)) {
bu_log("wgl_makeCurrent: Couldn't make context current\n");
return BRLCAD_ERROR;
@@ -1709,7 +1707,7 @@
HIDDEN int
wgl_configureWin(struct dm *dmp, int force)
{
- if (!wglMakeCurrent(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc,
+ if (!wglMakeCurrent(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc,
((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->glxc)) {
bu_log("wgl_configureWin: Couldn't make context current\n");
return BRLCAD_ERROR;
@@ -1900,7 +1898,7 @@
struct fb_platform_specific *fb_ps;
struct wgl_fb_info *wfb_ps;
struct modifiable_ogl_vars *mvars = (struct modifiable_ogl_vars
*)dmp->i->m_vars;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ struct dm_wglvars *pubvars = (struct dm_wglvars *)dmp->i->dm_vars.pub_vars;
struct wgl_vars *privars = (struct wgl_vars *)dmp->i->dm_vars.priv_vars;
fb_ps = fb_get_platform_specific(FB_WGL_MAGIC);
@@ -2132,7 +2130,7 @@
wgl_geometry_request(struct dm *dmp, int width, int height)
{
if (!dmp) return -1;
- Tk_GeometryRequest(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin,
width, height);
+ Tk_GeometryRequest(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin, width, height);
return 0;
}
@@ -2289,7 +2287,7 @@
dmp->i->dm_interp = interp;
dmp->i->dm_light = 1;
- BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_xvars);
+ BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_wglvars);
BU_ALLOC(dmp->i->dm_vars.priv_vars, struct wgl_vars);
dmp->i->dm_get_internal(dmp);
@@ -2320,9 +2318,9 @@
bu_vls_strcpy(&init_proc_vls, "bind_dm");
/* initialize dm specific variables */
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->devmotionnotify =
LASTEvent;
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->devbuttonpress =
LASTEvent;
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->devbuttonrelease =
LASTEvent;
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->devmotionnotify =
LASTEvent;
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->devbuttonpress =
LASTEvent;
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->devbuttonrelease =
LASTEvent;
dmp->i->dm_aspect = 1.0;
/* initialize modifiable variables */
@@ -2338,7 +2336,7 @@
mvars->boundFlag = dmp->i->dm_boundFlag;
/* this is important so that wgl_configureWin knows to set the font */
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->fontstruct = NULL;
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->fontstruct = NULL;
if (dmp->i->dm_width == 0) {
dmp->i->dm_width = GetSystemMetrics(SM_CXSCREEN) - 30;
@@ -2373,10 +2371,10 @@
Tcl_DStringFree(&ds);
return DM_NULL;
}
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin =
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->xtkwin =
Tk_NameToWindow(interp,
bu_vls_addr(&dmp->i->dm_pathName), tkwin);
Tcl_DStringFree(&ds);
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->top = ((struct
dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin;
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->top = ((struct
dm_wglvars *)dmp->i->dm_vars.pub_vars)->xtkwin;
}
else {
char *cp;
@@ -2383,7 +2381,7 @@
cp = strrchr(bu_vls_addr(&dmp->i->dm_pathName), (int)'.');
if (cp == bu_vls_addr(&dmp->i->dm_pathName)) {
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->top =
tkwin;
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->top =
tkwin;
}
else {
struct bu_vls top_vls = BU_VLS_INIT_ZERO;
@@ -2390,18 +2388,18 @@
bu_vls_strncpy(&top_vls, (const char
*)bu_vls_addr(&dmp->i->dm_pathName), cp - bu_vls_addr(&dmp->i->dm_pathName));
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->top =
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->top =
Tk_NameToWindow(interp, bu_vls_addr(&top_vls),
tkwin);
bu_vls_free(&top_vls);
}
/* Make xtkwin an embedded window */
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin =
- Tk_CreateWindow(interp, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->top,
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->xtkwin =
+ Tk_CreateWindow(interp, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->top,
cp + 1, (char *)NULL);
}
- if (((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin == NULL) {
+ if (((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->xtkwin == NULL) {
bu_log("open_gl: Failed to open %s\n",
bu_vls_addr(&dmp->i->dm_pathName));
bu_vls_free(&init_proc_vls);
(void)wgl_close(dmp);
@@ -2409,7 +2407,7 @@
}
bu_vls_printf(&dmp->i->dm_tkName, "%s",
- (char *)Tk_Name(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->xtkwin));
+ (char *)Tk_Name(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin));
bu_vls_printf(&str, "_init_dm %s %s\n",
bu_vls_addr(&init_proc_vls),
@@ -2426,30 +2424,30 @@
bu_vls_free(&init_proc_vls);
bu_vls_free(&str);
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->dpy =
- Tk_Display(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->top);
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->dpy =
+ Tk_Display(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->top);
/* make sure there really is a display before proceeding. */
- if (!((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->dpy) {
+ if (!((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->dpy) {
(void)wgl_close(dmp);
return DM_NULL;
}
- Tk_GeometryRequest(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->xtkwin,
+ Tk_GeometryRequest(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin,
dmp->i->dm_width,
dmp->i->dm_height);
- Tk_MakeWindowExist(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->xtkwin);
+ Tk_MakeWindowExist(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin);
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->win =
- Tk_WindowId(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->xtkwin);
- dmp->i->dm_id = ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->win;
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->win =
+ Tk_WindowId(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin);
+ dmp->i->dm_id = ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->win;
- hwnd = TkWinGetHWND(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->win);
+ hwnd = TkWinGetHWND(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->win);
hdc = GetDC(hwnd);
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc = hdc;
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->hdc = hdc;
- gotvisual = wgl_choose_visual(dmp, ((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->xtkwin);
+ gotvisual = wgl_choose_visual(dmp, ((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin);
if (!gotvisual) {
bu_log("wgl_open: Can't get an appropriate visual.\n");
(void)wgl_close(dmp);
@@ -2456,17 +2454,17 @@
return DM_NULL;
}
- ((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->depth = mvars->depth;
+ ((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->depth = mvars->depth;
/* open GLX context */
if ((((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->glxc =
- wglCreateContext(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->hdc)) == NULL) {
+ wglCreateContext(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc)) == NULL) {
bu_log("wgl_open: couldn't create glXContext.\n");
(void)wgl_close(dmp);
return DM_NULL;
}
- if (!wglMakeCurrent(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->hdc,
+ if (!wglMakeCurrent(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->hdc,
((struct wgl_vars *)dmp->i->dm_vars.priv_vars)->glxc)) {
bu_log("wgl_open: couldn't make context current\n");
(void)wgl_close(dmp);
@@ -2542,9 +2540,9 @@
return DM_NULL;
}
- Tk_MapWindow(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->xtkwin);
+ Tk_MapWindow(((struct dm_wglvars *)dmp->i->dm_vars.pub_vars)->xtkwin);
- Tk_CreateEventHandler(((struct dm_xvars
*)dmp->i->dm_vars.pub_vars)->xtkwin, VisibilityChangeMask, WGLEventProc,
(ClientData)dmp);
+ Tk_CreateEventHandler(((struct dm_wglvars
*)dmp->i->dm_vars.pub_vars)->xtkwin, VisibilityChangeMask, WGLEventProc,
(ClientData)dmp);
return dmp;
}
Modified: brlcad/branches/dm-fb-merge/src/libdm/wgl/dm-wgl.h
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/wgl/dm-wgl.h 2020-04-17 14:16:09 UTC
(rev 75434)
+++ brlcad/branches/dm-fb-merge/src/libdm/wgl/dm-wgl.h 2020-04-17 15:06:54 UTC
(rev 75435)
@@ -33,6 +33,10 @@
# include <GL/gl.h>
#endif
+#include "tk.h"
+#define HAVE_X11_TYPES 1
+#include "tkWinInt.h"
+
#include "bu/vls.h"
__BEGIN_DECLS
Modified: brlcad/branches/dm-fb-merge/src/mged/dm-generic.c
===================================================================
--- brlcad/branches/dm-fb-merge/src/mged/dm-generic.c 2020-04-17 14:16:09 UTC
(rev 75434)
+++ brlcad/branches/dm-fb-merge/src/mged/dm-generic.c 2020-04-17 15:06:54 UTC
(rev 75435)
@@ -540,7 +540,6 @@
return TCL_ERROR;
}
-#if defined(DM_X) || defined(DM_TK) || defined(DM_OGL) || defined(DM_WGL) ||
defined(DM_OSGL)
if (BU_STR_EQUAL(argv[0], "getx")) {
struct bu_vls tmp_vls = BU_VLS_INIT_ZERO;
if (argc == 1) {
@@ -553,7 +552,6 @@
bu_vls_free(&tmp_vls);
return TCL_OK;
}
-#endif
if (BU_STR_EQUAL(argv[0], "bg")) {
int r, g, b;
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