GRASS 8 Programmer's Manual 8.6.0dev(2026)-1878fdfec5
Loading...
Searching...
No Matches
driver/init.c
Go to the documentation of this file.
1/*!
2 \file lib/driver/init.c
3
4 \brief Display Driver - initialization
5
6 SPDX-FileCopyrightText: 2006-2011 GRASS Development Team
7 SPDX-License-Identifier: GPL-2.0-or-later
8
9 \author Glynn Clements <glynn gclements.plus.com> (original contributor)
10 \author Huidae Cho <grass4u gmail.com>
11*/
12
13#include <grass/config.h>
14
15#include <stdio.h>
16#include <stdlib.h>
17
18#include <grass/gis.h>
19#include <grass/fontcap.h>
20#include "driverlib.h"
21#include "driver.h"
22
23const struct driver *driver;
24
26
29
32
39
40/*!
41 \brief Initialize display driver
42
43 \param drv pointer to driver structure
44*/
45void LIB_init(const struct driver *drv)
46{
47 const char *p;
48
49 driver = drv;
51
52 /* initialize graphics */
53 p = getenv("GRASS_RENDER_WIDTH");
54 screen_width = (p && atoi(p)) ? atoi(p) : DEF_WIDTH;
55
56 p = getenv("GRASS_RENDER_HEIGHT");
57 screen_height = (p && atoi(p)) ? atoi(p) : DEF_HEIGHT;
58
59 if (COM_Graph_set() < 0)
60 exit(1);
61
63}
double text_size_y
Definition driver/init.c:34
double text_rotation
Definition driver/init.c:35
int screen_height
Definition driver/init.c:28
int matrix_valid
Definition driver/init.c:38
double text_cosrot
Definition driver/init.c:37
struct GFONT_CAP * ftcap
Definition driver/init.c:25
double text_size_x
Definition driver/init.c:33
int screen_width
Definition driver/init.c:27
double cur_x
Definition driver/init.c:30
double text_sinrot
Definition driver/init.c:36
double cur_y
Definition driver/init.c:31
void LIB_init(const struct driver *drv)
Initialize display driver.
Definition driver/init.c:45
const struct driver * driver
Definition driver/init.c:23
int COM_Graph_set(void)
Definition driver/graph.c:5
#define GRASS_DRIVER_EXPORT
Definition driver.h:9
void COM_Set_window(double, double, double, double)
#define DEF_HEIGHT
Definition driverlib.h:2
struct GFONT_CAP * parse_fontcap(void)
Parse fontcaps.
Definition parse_ftcap.c:71
#define DEF_WIDTH
Definition driverlib.h:1