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.dev/sumo
3 // Copyright (C) 2006-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // Global storage for textures; manages and draws them
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
27 
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
37 public:
39  static int getMaxTextureSize();
40 
42  static GUIGlID add(FXImage* i);
43 
45  static void drawTexturedBox(int which, double size);
46 
48  static void drawTexturedBox(int which, double sizeX1, double sizeY1, double sizeX2, double sizeY2);
49 
53  static int getTextureID(const std::string& filename, const bool mirrorX = false);
54 
56  static void clearTextures();
57 
59  static void allowTextures(const bool val) {
60  myAllowTextures = val;
61  }
62 
64  static bool texturesAllowed() {
65  return myAllowTextures;
66  }
67 
68 private:
70  static std::map<std::string, int> myTextures;
71 
73  static bool myAllowTextures;
74 };
unsigned int GUIGlID
Definition: GUIGlObject.h:43
Global storage for textures; manages and draws them.
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
static bool myAllowTextures
whether textures are drawn
static std::map< std::string, int > myTextures
mapping from image paths to decals (initialization on first use)
static GUIGlID add(FXImage *i)
Adds a texture to use.
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
static bool texturesAllowed()
ask whether texture drawing is enabled
static int getMaxTextureSize()
return maximum number of pixels in x and y direction
static void allowTextures(const bool val)
switch texture drawing on and off
static void clearTextures()
clears loaded textures