Exemple #1
0
/*
 * Usage:
 *	  procname configure width height
 */
int
fbo_configure_tcl(ClientData clientData, Tcl_Interp *interp, int argc, char **argv)
{
    struct fb_obj *fbop = (struct fb_obj *)clientData;
    int width, height;

    if (argc != 4) {
	struct bu_vls vls;

	bu_vls_init(&vls);
	bu_vls_printf(&vls, "helplib fb_configure");
	Tcl_Eval(interp, bu_vls_addr(&vls));
	bu_vls_free(&vls);
	return TCL_ERROR;
    }

    if (sscanf(argv[2], "%d", &width) != 1) {
	Tcl_AppendResult(interp, "fb_configure: bad width - ",
			 argv[2], (char *)NULL);
	return TCL_ERROR;
    }

    if (sscanf(argv[3], "%d", &height) != 1) {
	Tcl_AppendResult(interp, "fb_configure: bad height - ",
			 argv[3], (char *)NULL);
	return TCL_ERROR;
    }

    /* configure the framebuffer window */
    if (fbop->fbo_fbs.fbs_fbp != FBIO_NULL)
	fb_configureWindow(fbop->fbo_fbs.fbs_fbp, width, height);

    return TCL_OK;
}
Exemple #2
0
/*
 * Usage:
 * procname configure width height
 */
HIDDEN int
fbo_configure_tcl(void *clientData, int argc, const char **argv)
{
    struct fb_obj *fbop = (struct fb_obj *)clientData;
    int width, height;

    if (argc != 4) {
	bu_log("ERROR: expecting four arguments\n");
	return BRLCAD_ERROR;
    }

    if (sscanf(argv[2], "%d", &width) != 1) {
	bu_log("fb_configure: bad width - %s", argv[2]);
	return BRLCAD_ERROR;
    }

    if (sscanf(argv[3], "%d", &height) != 1) {
	bu_log("fb_configure: bad height - %s", argv[3]);
	return BRLCAD_ERROR;
    }

    /* configure the framebuffer window */
    if (fbop->fbo_fbs.fbs_fbp != FBIO_NULL)
	fb_configureWindow(fbop->fbo_fbs.fbs_fbp, width, height);

    return BRLCAD_OK;
}