SUMO - Simulation of Urban MObility
GUITexturesHelper.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2006-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Global storage for textures; manages and draws them
20 /****************************************************************************/
21 #ifndef GUITexturesHelper_h
22 #define GUITexturesHelper_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <fx.h>
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
46 public:
48  static int getMaxTextureSize();
49 
51  static GUIGlID add(FXImage* i);
52 
54  static void drawTexturedBox(int which, double size);
55 
57  static void drawTexturedBox(int which, double sizeX1, double sizeY1, double sizeX2, double sizeY2);
58 
62  static int getTextureID(const std::string& filename, const bool mirrorX = false);
63 
65  static void clearTextures();
66 
68  static void allowTextures(const bool val) {
69  myAllowTextures = val;
70  }
71 
73  static bool texturesAllowed() {
74  return myAllowTextures;
75  }
76 
77 private:
79  static std::map<std::string, int> myTextures;
80 
82  static bool myAllowTextures;
83 };
84 
85 
86 #endif
87 
88 /****************************************************************************/
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
static GUIGlID add(FXImage *i)
Adds a texture to use.
static std::map< std::string, int > myTextures
mapping from image paths to decals (initialization on first use)
static bool texturesAllowed()
ask whether texture drawing is enabled
static void clearTextures()
clears loaded textures
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
static bool myAllowTextures
whether textures are drawn
unsigned int GUIGlID
Definition: GUIGlObject.h:49
static int getMaxTextureSize()
return maximum number of pixels in x and y direction
Global storage for textures; manages and draws them.
static void allowTextures(const bool val)
switch texture drawing on and off