navit
0.5.3-trunk
|
#include <glib.h>
#include <unistd.h>
#include <math.h>
#include <stdio.h>
#include <time.h>
#include "item.h"
#include "attr.h"
#include "config.h"
#include "point.h"
#include "graphics.h"
#include "color.h"
#include "plugin.h"
#include "event.h"
#include "debug.h"
#include "callback.h"
#include "keys.h"
#include "window.h"
#include "navit/font/freetype/font_freetype.h"
#include "graphics_opengl.h"
#include <GL/glut.h>
Data Structures | |
struct | graphics_gc_priv |
struct | graphics_priv |
struct | graphics_image_priv |
struct | mouse_event_queue_element |
Macros | |
#define | USE_FLOAT 0 |
#define | REQUIRES_POWER_OF_2 0 |
#define | PIXEL_FORMAT GL_BGRA |
#define | glOrthof glOrtho |
#define | USE_FLOAT 1 |
#define | glF(x) x |
#define | glD(x) x |
#define | GL_F GL_FLOAT |
#define | SCREEN_WIDTH 700 |
#define | SCREEN_HEIGHT 700 |
Typedefs | |
typedef GLfloat | GLf |
Functions | |
void APIENTRY | tessBeginCB (GLenum which) |
void APIENTRY | tessEndCB (void) |
void APIENTRY | tessErrorCB (GLenum errorCode) |
void APIENTRY | tessVertexCB (const GLvoid *data) |
void APIENTRY | tessVertexCB2 (const GLvoid *data) |
void APIENTRY | tessCombineCB (GLdouble c[3], void *d[4], GLfloat w[4], void **out) |
const char * | getPrimitiveType (GLenum type) |
static struct graphics_priv * | graphics_opengl_new_helper (struct graphics_methods *meth) |
static void | display (void) |
static void | resize_callback (int w, int h) |
static void | motion_notify_do (struct graphics_priv *priv, int x, int y) |
static void | resize_callback_do (struct graphics_priv *priv, int w, int h) |
static void | glut_close (void) |
static void | graphics_destroy (struct graphics_priv *gr) |
static void | gc_destroy (struct graphics_gc_priv *gc) |
static void | gc_set_linewidth (struct graphics_gc_priv *gc, int w) |
static void | gc_set_dashes (struct graphics_gc_priv *gc, int width, int offset, unsigned char *dash_list, int n) |
static void | gc_set_foreground (struct graphics_gc_priv *gc, struct color *c) |
static void | gc_set_background (struct graphics_gc_priv *gc, struct color *c) |
static struct graphics_gc_priv * | gc_new (struct graphics_priv *gr, struct graphics_gc_methods *meth) |
static struct graphics_image_priv * | image_new (struct graphics_priv *gr, struct graphics_image_methods *meth, char *path, int *w, int *h, struct point *hot, int rotation) |
static void | set_color (struct graphics_priv *gr, struct graphics_gc_priv *gc) |
static void | draw_array (struct graphics_priv *gr, struct point *p, int count, GLenum mode) |
static void | draw_rectangle_do (struct graphics_priv *gr, struct point *p, int w, int h) |
static void | get_overlay_pos (struct graphics_priv *gr, struct point *point_out) |
static void | draw_lines (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count) |
static void | draw_polygon (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count) |
static void | draw_rectangle (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h) |
static void | display_text_draw (struct font_freetype_text *text, struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, int color, struct point *p) |
static void | draw_text (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) |
static void | draw_image (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img) |
static void | draw_drag (struct graphics_priv *gr, struct point *p) |
static void | background_gc (struct graphics_priv *gr, struct graphics_gc_priv *gc) |
static void | handle_mouse_queue (void) |
static int | redraw_screen (struct graphics_priv *gr) |
static gboolean | redraw_filter (gpointer data) |
static void | draw_mode (struct graphics_priv *gr, enum draw_mode_num mode) |
static struct graphics_priv * | overlay_new (struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound) |
static int | graphics_opengl_fullscreen (struct window *w, int on) |
static void | graphics_opengl_disable_suspend (struct window *w) |
static void * | get_data (struct graphics_priv *this, const char *type) |
static void | image_free (struct graphics_priv *gr, struct graphics_image_priv *priv) |
static void | overlay_disable (struct graphics_priv *gr, int disable) |
static void | overlay_resize (struct graphics_priv *gr, struct point *p, int w, int h, int wraparound) |
static void | click_notify (int button, int state, int x, int y) |
static void | motion_notify (int x, int y) |
static gboolean | graphics_opengl_idle (void *data) |
static void | ProcessNormalKeys (unsigned char key_in, int x, int y) |
static void | ProcessSpecialKeys (int key_in, int x, int y) |
static struct graphics_priv * | graphics_opengl_new (struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl) |
static void | event_opengl_main_loop_run (void) |
static void | event_opengl_main_loop_quit (void) |
static struct event_watch * | event_opengl_add_watch (int fd, enum event_watch_cond cond, struct callback *cb) |
static void | event_opengl_remove_watch (struct event_watch *ev) |
static struct event_timeout * | event_opengl_add_timeout (int timeout, int multi, struct callback *cb) |
static void | event_opengl_remove_timeout (struct event_timeout *to) |
static struct event_idle * | event_opengl_add_idle (int priority, struct callback *cb) |
static void | event_opengl_remove_idle (struct event_idle *ev) |
static void | event_opengl_call_callback (struct callback_list *cb) |
static struct event_priv * | event_opengl_new (struct event_methods *meth) |
void | plugin_init (void) |
Variables | |
struct graphics_gc_priv | graphics_gc_priv |
static struct graphics_priv * | graphics_priv_root |
struct graphics_image_priv | graphics_image_priv |
static const int | mouse_event_queue_size = 100 |
static int | mouse_event_queue_begin_idx = 0 |
static int | mouse_event_queue_end_idx = 0 |
static struct mouse_event_queue_element | mouse_queue [100] |
static GHashTable * | hImageData |
static struct graphics_gc_methods | gc_methods |
static int | tess_count |
static struct point | tess_array [512] |
static GLenum | tess_type |
static struct graphics_methods | graphics_methods |
static struct event_methods | event_opengl_methods |
#define GL_F GL_FLOAT |
#define glD | ( | x | ) | x |
#define glF | ( | x | ) | x |
#define glOrthof glOrtho |
#define PIXEL_FORMAT GL_BGRA |
#define REQUIRES_POWER_OF_2 0 |
#define SCREEN_HEIGHT 700 |
#define SCREEN_WIDTH 700 |
#define USE_FLOAT 0 |
Navit, a modular navigation system. Copyright (C) 2005-2010 Navit Team
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define USE_FLOAT 1 |
Navit, a modular navigation system. Copyright (C) 2005-2010 Navit Team
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
typedef GLfloat GLf |
|
static |
References graphics_priv::background_gc.
|
static |
References mouse_event_queue_element::button, graphics_priv_root, mouse_event_queue_end_idx, mouse_event_queue_size, mouse_queue, mouse_event_queue_element::state, graphics_priv::width, mouse_event_queue_element::x, point::x, mouse_event_queue_element::y, and point::y.
Referenced by graphics_opengl_new().
|
static |
References graphics_priv::force_redraw, graphics_priv_root, graphics_priv::height, redraw_screen(), resize_callback(), and graphics_priv::width.
Referenced by graphics_opengl_egl_new(), graphics_opengl_new(), gui_internal_cmd_position_do(), gui_internal_dbus_signal(), gui_qml_dbus_signal(), and org.navitproject.navit.Navit::onCreate().
|
static |
References color::a, color::b, COLOR_IS_BLACK, COLOR_IS_WHITE, draw_image_es(), font_freetype_glyph::dx, font_freetype_glyph::dy, graphics_gc_priv::fa, graphics_gc_priv::fb, graphics_gc_priv::fg, graphics_gc_priv::fr, graphics_priv::freetype_methods, color::g, font_freetype_methods::get_glyph, font_freetype_methods::get_shadow, font_freetype_text::glyph, font_freetype_text::glyph_count, font_freetype_glyph::h, p, PIXEL_FORMAT, color::r, font_freetype_glyph::w, font_freetype_glyph::x, point::x, font_freetype_glyph::y, and point::y.
Referenced by draw_text().
|
static |
References GL_F, glF, p, and graphics_priv::position_location.
Referenced by draw_lines(), draw_polygon(), draw_rectangle_do(), and tessEndCB().
|
static |
References graphics_priv::p, p, point::x, and point::y.
|
static |
|
static |
|
static |
References graphics_priv::DLid, draw_mode_begin, draw_mode_end, graphics_priv::force_redraw, graphics_priv::mode, graphics_priv::overlay_enabled, graphics_priv::parent, graphics_priv::platform, graphics_priv::platform_methods, redraw_screen(), and graphics_opengl_platform_methods::swap_buffers.
Referenced by overlay_disable().
|
static |
|
static |
|
static |
References draw_array(), p, point::x, and point::y.
Referenced by draw_rectangle().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
References event_opengl_methods.
Referenced by plugin_init().
|
static |
|
static |
|
static |
|
static |
|
static |
References gc_methods, graphics_gc_priv::gr, and graphics_gc_priv::linewidth.
|
static |
|
static |
References graphics_gc_priv::dash_count, and graphics_gc_priv::dash_mask.
|
static |
References c, graphics_gc_priv::fa, graphics_gc_priv::fb, graphics_gc_priv::fg, and graphics_gc_priv::fr.
|
static |
References graphics_gc_priv::linewidth, and graphics_priv::w.
|
static |
References window::disable_suspend, fragment_src, window::fullscreen, graphics_opengl_disable_suspend(), graphics_opengl_egl_new(), graphics_opengl_fullscreen(), graphics_opengl_x11_new(), height, load_shader(), motion_notify_do(), window::priv, resize_callback(), resize_callback_do(), type, vertex_src, and width.
|
static |
References graphics_priv::height, graphics_priv::p, graphics_priv::parent, graphics_priv::width, point::x, and point::y.
Referenced by redraw_screen().
const char * getPrimitiveType | ( | GLenum | type | ) |
References type.
Referenced by tessBeginCB().
|
static |
References callback_list_call_attr_0, graphics_priv::cbl, and graphics_priv_root.
Referenced by graphics_opengl_new().
|
static |
References font_freetype_methods::destroy, and graphics_priv::freetype_methods.
|
static |
Referenced by get_data().
|
static |
Referenced by get_data().
|
static |
References callback_list_call_attr_2, graphics_priv::cbl, graphics_priv_root, handle_mouse_queue(), graphics_priv::height, and graphics_priv::width.
Referenced by graphics_opengl_new().
|
static |
References argc, attr_search(), graphics_priv::cbl, cbl, click_notify(), graphics_priv::delay, display(), graphics_priv::DLid, event_request_system(), glut_close(), graphics_opengl_idle(), graphics_opengl_new_helper(), graphics_priv_root, graphics_priv::height, height, hImageData, motion_notify(), graphics_priv::nav, attr::num, graphics_priv::overlay_enabled, ProcessNormalKeys(), ProcessSpecialKeys(), redraw_filter(), resize_callback(), SCREEN_HEIGHT, SCREEN_WIDTH, graphics_priv::timeout, attr::u, graphics_priv::width, and width.
Referenced by plugin_init().
|
static |
References font_freetype_new(), graphics_methods::font_new, graphics_priv::freetype_methods, graphics_methods::get_text_bbox, and graphics_methods.
Referenced by graphics_opengl_new(), and overlay_new().
|
static |
References callback_list_call_attr_3, graphics_priv::cbl, graphics_priv::force_redraw, graphics_priv_root, mouse_event_queue_begin_idx, mouse_event_queue_end_idx, mouse_event_queue_size, mouse_queue, p, mouse_event_queue_element::x, and mouse_event_queue_element::y.
Referenced by graphics_opengl_idle().
|
static |
|
static |
|
static |
References graphics_priv_root, motion_notify_do(), point::x, and point::y.
Referenced by graphics_opengl_new().
|
static |
References callback_list_call_attr_1, graphics_priv::cbl, p, graphics_priv::width, point::x, and point::y.
Referenced by get_data(), and motion_notify().
|
static |
References draw_mode(), draw_mode_end, graphics_priv::force_redraw, and graphics_priv::overlay_enabled.
|
static |
|
static |
void plugin_init | ( | void | ) |
References event_opengl_new(), and graphics_opengl_new().
|
static |
References callback_list_call_attr_1, graphics_priv::cbl, graphics_priv::force_redraw, graphics_priv_root, key, and NAVIT_KEY_RETURN.
Referenced by graphics_opengl_new().
|
static |
References callback_list_call_attr_1, graphics_priv::cbl, graphics_priv::force_redraw, graphics_priv_root, key, NAVIT_KEY_DOWN, NAVIT_KEY_LEFT, NAVIT_KEY_RIGHT, NAVIT_KEY_UP, NAVIT_KEY_ZOOM_IN, and NAVIT_KEY_ZOOM_OUT.
Referenced by graphics_opengl_new().
|
static |
References data, graphics_priv::dirty, graphics_priv::overlay_enabled, and redraw_screen().
Referenced by graphics_opengl_new().
|
static |
References graphics_priv::dirty, graphics_priv::DLid, get_overlay_pos(), graphics_priv_root, graphics_priv::next, graphics_priv::overlay, graphics_priv::overlay_enabled, graphics_priv::overlays, point::x, and point::y.
Referenced by display(), draw_mode(), and redraw_filter().
|
static |
References graphics_priv_root, and resize_callback_do().
Referenced by display(), get_data(), and graphics_opengl_new().
|
static |
References callback_list_call_attr_2, graphics_priv::cbl, glF, glOrthof, graphics_priv::height, and graphics_priv::width.
Referenced by get_data(), and resize_callback().
|
static |
References graphics_priv::color_location, graphics_gc_priv::fa, graphics_gc_priv::fb, graphics_gc_priv::fg, graphics_gc_priv::fr, and glF.
Referenced by draw_lines(), draw_polygon(), and draw_rectangle().
void APIENTRY tessBeginCB | ( | GLenum | which | ) |
References dbg, getPrimitiveType(), lvl_debug, tess_count, and tess_type.
Referenced by draw_polygon().
void APIENTRY tessCombineCB | ( | GLdouble | c[3], |
void * | d[4], | ||
GLfloat | w[4], | ||
void ** | out | ||
) |
References c.
Referenced by draw_polygon().
void APIENTRY tessEndCB | ( | void | ) |
References dbg, draw_array(), graphics_priv_root, lvl_debug, tess_array, tess_count, and tess_type.
Referenced by draw_polygon().
void APIENTRY tessErrorCB | ( | GLenum | errorCode | ) |
void APIENTRY tessVertexCB | ( | const GLvoid * | data | ) |
References data, dbg, lvl_debug, lvl_error, tess_array, tess_count, point::x, and point::y.
Referenced by draw_polygon().
void APIENTRY tessVertexCB2 | ( | const GLvoid * | data | ) |
|
static |
Referenced by event_opengl_new().
|
static |
Referenced by gc_new().
struct graphics_gc_priv graphics_gc_priv |
|
static |
Referenced by graphics_opengl_new_helper().
|
static |
Referenced by click_notify(), display(), draw_image(), draw_lines(), draw_polygon(), draw_rectangle(), draw_text(), glut_close(), graphics_opengl_idle(), graphics_opengl_new(), handle_mouse_queue(), motion_notify(), ProcessNormalKeys(), ProcessSpecialKeys(), redraw_screen(), resize_callback(), and tessEndCB().
|
static |
Referenced by graphics_opengl_new(), and image_new().
|
static |
Referenced by handle_mouse_queue().
|
static |
Referenced by click_notify(), and handle_mouse_queue().
|
static |
Referenced by click_notify(), and handle_mouse_queue().
|
static |
Referenced by click_notify(), and handle_mouse_queue().
|
static |
Referenced by tessEndCB(), and tessVertexCB().
|
static |
Referenced by tessBeginCB(), tessEndCB(), and tessVertexCB().
|
static |
Referenced by tessBeginCB(), and tessEndCB().