Пример #1
0
int main(int, char **)
{
    VGint i;
    i = 2;
    vgFlush();
    vgDestroyContextSH();
    return 0;
}
Пример #2
0
void testCleanup(void)
{
  CleanupFunc callback =
    (CleanupFunc)callbacks[TEST_CALLBACK_CLEANUP];
  
  if (callback)
    (*callback)();
  
  vgDestroyContextSH();
  if (overtext) free(overtext);
}
static void
_cairo_boilerplate_vg_cleanup_glx (void *closure)
{
    vg_closure_glx_t *vgc = closure;

#ifdef USE_AMANITH
    vgDestroyContextAM ();
#endif
#ifdef USE_SHIVA
    vgDestroyContextSH ();
#endif

    glXDestroyContext (vgc->dpy, vgc->ctx);
    XDestroyWindow (vgc->dpy, vgc->win);
    XCloseDisplay (vgc->dpy);
    free (vgc);
}
static void
_cairo_boilerplate_vg_cleanup_egl (void *closure)
{
    vg_closure_egl_t *vgc = closure;

#ifdef USE_AMANITH
    vgDestroyContextAM ();
#endif
#ifdef USE_SHIVA
    vgDestroyContextSH ();
#endif

    eglDestroyContext (vgc->dpy, vgc->ctx);
    eglDestroySurface (vgc->dpy, vgc->dummy);
    eglTerminate (vgc->dpy);
    free (vgc);
}
Пример #5
0
	// C function:: void vgDestroyContextSH(void);
	JNIEXPORT jint JNICALL
	Java_com_example_startvg_VG11_vgDestroyContextSH(
	  JNIEnv* env, jobject obj){
	  
		vgDestroyContextSH();
	}
QShivaContext::~QShivaContext()
{
    if (initialized)
        vgDestroyContextSH();
}
Пример #7
0
int main() {
	int running = GL_TRUE;
	int width = 640;
	int height = 480;
	int x = 50;
	int y = 50;
	int w = 10;
	int h = 10;
	/*
	Window *win = check_malloc (sizeof(Window));
	win->width = 640;
	win->height = 480;
	*/

	// Initialize GLFW, create a ShivaVG context, open a window

	if( !glfwInit() )
	{
		return 1; // Couldn't initialize GLFW
	}

	int n = glfwOpenWindow(width, height, 0,0,0,0,0,0, GLFW_WINDOW);
	if (!n) {
		glfwTerminate(); // Cleanup GLFW
		return 1; // Couldn't create a window
	}

	glfwSetWindowCloseCallback(window_close_callback);

	glfwSetWindowTitle("Shiva test");

	vgCreateContextSH(width, height); // XXX: TODO: handle errors!!!!
	
	/*
	Rect *r = make_rect(0,0,100,100,0,1,1,1);
	win->rect = r;
	*/
	
	//make color
	VGPaint paint;
	VGfloat paint_array[] = {1,0,1,1};
	paint = vgCreatePaint();
    vgSetParameterfv(paint, VG_PAINT_COLOR, 4, paint_array);
	
	//make rect

	VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
								1,0,0,0, VG_PATH_CAPABILITY_ALL);
	vguRect(path, 0, 0, w, h);


	VGfloat magenta[] = {0.9,0,0,1};
	

	while (running) {
			
		vgSetfv(VG_CLEAR_COLOR, 4, magenta);
		vgClear(0, 0, width, height);
		
		vgLoadIdentity();

		vgTranslate(x, y);
		vgSetPaint(paint, VG_FILL_PATH);
		vgDrawPath(path, VG_FILL_PATH);

		glfwSwapBuffers();	

		// Terminate when ESC is pressed or the window is closed
		running = !glfwGetKey(GLFW_KEY_ESC) && glfwGetWindowParam(GLFW_OPENED);
	}

	// Close the window, clean up the ShivaVG context, and clean up GLFW
	vgDestroyContextSH();

	// Close window and terminate GLFW
	glfwTerminate();

	
	return 0;
}