Description:
Make ImageMap and ImGuiImageMap no longer static.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -193,9 +193,8 | |||
|
193 | 193 | Tile.TileSetTexture = Content.Load<Texture2D>(@"part4_tileset"); |
|
194 | 194 | var texture = Content.Load<Texture2D>(@"solid_tileset"); |
|
195 | 195 | |
|
196 |
|
|
|
197 | ImGuiImageMap.ImGuiTexture = _imGuiRenderer.BindTexture(ImageMap.ImageMapTexture); | |
|
198 | this.imageMap = new ImGuiImageMap(500, 400); | |
|
196 | var imageMapTexture = Content.Load<Texture2D>(@"photos_converted3"); | |
|
197 | this.imageMap = new ImGuiImageMap(500, 400, imageMapTexture, _imGuiRenderer); | |
|
199 | 198 | |
|
200 | 199 | Line.initialize(GraphicsDevice); |
|
201 | 200 | Quad.Initialize(GraphicsDevice, texture); |
@@ -4,17 +4,19 | |||
|
4 | 4 | using Num = System.Numerics; |
|
5 | 5 | using Microsoft.Xna.Framework; |
|
6 | 6 | using Microsoft.Xna.Framework.Graphics; |
|
7 | using ImGuiNET.SampleProgram.XNA; //for renderer | |
|
8 | ||
|
7 | 9 | |
|
8 | 10 | namespace isometricparkfna |
|
9 | 11 | { |
|
10 | 12 | public class ImGuiImageMap : ImageMap |
|
11 | 13 | { |
|
12 |
public |
|
|
14 | public IntPtr ImGuiTexture; | |
|
13 | 15 | |
|
14 | public ImGuiImageMap(int tileWidth, int tileHeight) : base(tileWidth, tileHeight) | |
|
16 | public ImGuiImageMap(int tileWidth, int tileHeight, Texture2D ImageMapTexture, ImGuiRenderer renderer) : base(tileWidth, tileHeight, ImageMapTexture) | |
|
17 | ||
|
15 | 18 | { |
|
19 | this.ImGuiTexture = renderer.BindTexture(this.ImageMapTexture); | |
|
16 | 20 | } |
|
17 | ||
|
18 | ||
|
19 | 21 | } |
|
20 | 22 | } |
@@ -8,12 +8,12 | |||
|
8 | 8 | { |
|
9 | 9 | public class ImageMap |
|
10 | 10 | { |
|
11 |
|
|
|
11 | public Texture2D ImageMapTexture; | |
|
12 | 12 | |
|
13 | 13 | public int TileWidth; |
|
14 | 14 | public int TileHeight; |
|
15 | 15 | |
|
16 | public ImageMap(int tileWidth, int tileHeight ) | |
|
16 | public ImageMap(int tileWidth, int tileHeight, Texture2D ImageMapTexture) | |
|
17 | 17 | { |
|
18 | 18 | this.TileHeight = tileHeight; |
|
19 | 19 | this.TileWidth = tileWidth; |
@@ -61,8 +61,5 | |||
|
61 | 61 | return new Rectangle(tileX * TileWidth, tileY * TileHeight, TileWidth, TileHeight*height); |
|
62 | 62 | } |
|
63 | 63 | |
|
64 | ||
|
65 | ||
|
66 | ||
|
67 | 64 | } |
|
68 | 65 | } |
You need to be logged in to leave comments.
Login now