Window functions
Functions for the game-window.
- Structures and Enumerations
- Opening and closing the game-window
- VG3_window_new()
Open window. - VG3_window_free()
Close window. - Window properties
- VG3_window_attributes()
Set attributes of window (transparency or color). - VG3_window_getsize()
Get size of window. - Updating the screen with window-contents
- VG3_window_update()
Show contents of window onto the screen. - Changing the window
- VG3_window_change()
Change window-scaling. - Environment variables There are additional environment variables, which influence the program executing
- VGAG3_RENDERER
Set a renderer, e.g. opengl or software - VGAG3_SCALE_NEAREST
Set to 1: use nearest pixel sampling, instead of linear filtering (if possible) - VGAG3_SCALE_INTEGER
Set to 1: use integer-scaling, instead of float-scaling (float-scaling could be slower)
Example
struct vg3_window *wstruct; struct vg3_image_attributes wattr; int winw, winh; /* open window */ wstruct = VG3_window_new(argv[0], VGAG3_VGAVERSION_LOW, VGAG3_WINSCALE_BESTSCALE); if (wstruct == NULL) { fprintf(stderr, "%s\n", VG3_error()); exit(1); } /* print window-size */ VG3_window_getsize(wstruct, &winw, &winh); printf("Window-Size: %dx%d\n", winw, winh), /* retrieve actual window-attributes */ VG3_window_attributes(wstruct, NULL, &wattr, -1, NULL); printf("Brightness=%d, transparency=%d, zoom=%d, rotating=%d, flipping=%d, fullfill=%d\n", (int)wattr.bright, (int)wattr.alpha, wattr.zoom, wattr.rotate, wattr.flip, wattr.fullfill); /* show window-contents */ VG3_window_update(wstruct, 0, 0); /* close window */ VG3_window_free(wstruct);