Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Global storage for textures; manages and draws them
18 /****************************************************************************/
19 #ifndef GUITexturesHelper_h
20 #define GUITexturesHelper_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <fx.h>
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
40 public:
42  static int getMaxTextureSize();
43 
45  static GUIGlID add(FXImage* i);
46 
48  static void drawTexturedBox(int which, double size);
49 
51  static void drawTexturedBox(int which, double sizeX1, double sizeY1, double sizeX2, double sizeY2);
52 
56  static int getTextureID(const std::string& filename, const bool mirrorX = false);
57 
59  static void clearTextures();
60 
62  static void allowTextures(const bool val) {
63  myAllowTextures = val;
64  }
65 
67  static bool texturesAllowed() {
68  return myAllowTextures;
69  }
70 
71 private:
73  static std::map<std::string, int> myTextures;
74 
76  static bool myAllowTextures;
77 };
78 
79 
80 #endif
81 
82 /****************************************************************************/
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:43
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