#include "UI_resources.h"
/*
-#include "RE_pipeline.h"
-#include "IMB_imbuf_types.h"*/
+#include "RE_pipeline.h"*/
+#include "IMB_imbuf_types.h"
/*#include "blendef.h"
#include "butspace.h"*/
glEnd();
}
+#endif
-static void draw_nodespace_back_pix(ScrArea *sa, SpaceNode *snode)
+void draw_nodespace_back_pix(ScrArea *sa, SpaceNode *snode)
{
- draw_nodespace_grid(snode);
-
if((snode->flag & SNODE_BACKDRAW) && snode->treetype==NTREE_COMPOSIT) {
Image *ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
int x, y;
/* somehow the offset has to be calculated inverse */
- glaDefine2DArea(&sa->winrct);
+ //glaDefine2DArea(&sa->winrct);
/* ortho at pixel level curarea */
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
+ //myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
x = (sa->winx-ibuf->x)/2 + snode->xof;
y = (sa->winy-ibuf->y)/2 + snode->yof;
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float);
/* sort this out, this should not be needed */
- myortho2(snode->v2d.cur.xmin, snode->v2d.cur.xmax, snode->v2d.cur.ymin, snode->v2d.cur.ymax);
- bwin_clear_viewmat(sa->win); /* clear buttons view */
+ //myortho2(snode->v2d.cur.xmin, snode->v2d.cur.xmax, snode->v2d.cur.ymin, snode->v2d.cur.ymax);
+ //bwin_clear_viewmat(sa->win); /* clear buttons view */
glLoadIdentity();
}
}
}
+#if 0
#if 0
/* note: needs to be userpref or opengl profile option */
static void draw_nodespace_back_tex(ScrArea *sa, SpaceNode *snode)
/* ************** Socket callbacks *********** */
-#if 0
static void socket_vector_menu_cb(bContext *C, void *node_v, void *ntree_v)
{
if(node_v && ntree_v) {
// addqueue(curarea->win, UI_BUT_EVENT, B_NODE_EXEC+((bNode *)node_v)->nr); XXX
}
}
-#endif
/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
static uiBlock *socket_vector_menu(bContext *C, uiMenuBlockHandle *handle, void *socket_v)
{
-#if 0 //XXX
- SpaceNode *snode= curarea->spacedata.first;
+ SpaceNode *snode= (SpaceNode *)CTX_wm_space_data(C);
+ ScrArea *curarea= CTX_wm_area(C);
bNode *node;
bNodeSocket *sock= socket_v;
bNodeStack *ns= &sock->ns;
break;
}
- block= uiNewBlock(&curarea->uiblocks, "socket menu", UI_EMBOSS, UI_HELV, curarea->win);
+ block= uiBeginBlock(C, handle->region, "socket menu", UI_EMBOSS, UI_HELV);
/* use this for a fake extra empy space around the buttons */
uiDefBut(block, LABEL, 0, "", -4, -4, 188, 68, NULL, 0, 0, 0, 0, "");
uiButSetFunc(bt, socket_vector_menu_cb, node, snode->nodetree);
uiBlockSetDirection(block, UI_TOP);
+ uiEndBlock(C, block);
- // allqueue(REDRAWNODE, 0);
+ ED_area_tag_redraw(curarea);
return block;
-#endif
-return NULL;
}
/* not a callback */
float col[3];
View2DScrollers *scrollers;
SpaceNode *snode= (SpaceNode*)CTX_wm_space_data(C);
+ ScrArea *sa= CTX_wm_area(C);
+ int argus;
+
+ argus= 1.1f+ 2.3f;
UI_GetThemeColor3fv(TH_BACK, col);
glClearColor(col[0], col[1], col[2], 0.0);
glEnable(GL_MAP1_VERTEX_3);
/* aspect+font, set each time */
- //snode->aspect= (snode->v2d.cur.xmax - snode->v2d.cur.xmin)/((float)sa->winx);
+ snode->aspect= (v2d->cur.xmax - v2d->cur.xmin)/((float)sa->winx);
//snode->curfont= uiSetCurFont_ext(snode->aspect);
UI_view2d_constant_grid_draw(C, v2d);
/* backdrop */
- // draw_nodespace_back_pix(sa, snode);
+ draw_nodespace_back_pix(CTX_wm_area(C), snode);
/* nodes */
snode_set_context(snode, CTX_data_scene(C));
snode->flag &= ~SNODE_DO_PREVIEW;
}*/
-
-
/* reset view matrix */
UI_view2d_view_restore(C);