Quote Originally Posted by Inferrd View Post
You might be using a different spritebatch for the map box and for the tileset box, but you use the same Texture2D object (TileSet) for both. As that was created with a reference to the map box's GraphicsDevice, it is (presumably?) only renderable in the map box.

I would change the global scope of your OurContent variable to being declared locally within each InitalizeGraphics functions and then create any needed Texture2D objects within those functions.
vb.net Code:
  1. Imports System.Windows.Forms
  2.  
  3. Module modPublics
  4.  
  5.     Public GDevice_MAP As GraphicsDevice
  6.     Public SBatch_MAP As SpriteBatch
  7.  
  8.     Public GDevice_TILESET As GraphicsDevice
  9.     Public SBatch_TILESET As SpriteBatch
  10.  
  11.     Public Tileset As Texture2D = Nothing
  12.     Public Mapset As Texture2D = Nothing
  13.  
  14.  
  15.     Public Function InitalizeGraphics_TILESET(ByRef Surface As PictureBox) As Boolean
  16.         Dim retValue As Boolean
  17.  
  18.         Try
  19.             Dim PParam As New PresentationParameters
  20.             PParam.PresentationInterval = PresentInterval.Immediate
  21.             PParam.DeviceWindowHandle = Surface.Handle
  22.             PParam.IsFullScreen = False
  23.  
  24.             Dim GAdapter As GraphicsAdapter = GraphicsAdapter.Adapters.Item(0)
  25.             GDevice_TILESET = New GraphicsDevice(GAdapter, GraphicsProfile.HiDef, PParam)
  26.  
  27.             SBatch_TILESET = New SpriteBatch(GDevice_TILESET)
  28.  
  29.             Dim OurContent = New clsContent.GameContent(GDevice_TILESET)
  30.             OurContent.Content.RootDirectory = "Content"
  31.             '//LOAD GRAPHICS
  32.             Tileset = OurContent.Content.Load(Of Texture2D)("Content/Graphics/Tilesets/0")
  33.  
  34.             retValue = True
  35.  
  36.         Catch ex As Exception
  37.             retValue = False
  38.               MessageBox.Show(ex.Message)
  39.         End Try
  40.  
  41.         Return retValue
  42.     End Function
  43.  
  44.  
  45.     Public Function InitalizeGraphics_MAP(ByRef Surface As PictureBox) As Boolean
  46.         Dim retValue As Boolean
  47.  
  48.         Try
  49.             Dim PParam As New PresentationParameters
  50.             PParam.PresentationInterval = PresentInterval.Immediate
  51.             PParam.DeviceWindowHandle = Surface.Handle
  52.             PParam.IsFullScreen = False
  53.  
  54.             Dim GAdapter As GraphicsAdapter = GraphicsAdapter.Adapters.Item(0)
  55.             GDevice_MAP = New GraphicsDevice(GAdapter, GraphicsProfile.HiDef, PParam)
  56.  
  57.             SBatch_MAP = New SpriteBatch(GDevice_MAP)
  58.  
  59.             Dim OurContent = New clsContent.GameContent(GDevice_MAP)
  60.             OurContent.Content.RootDirectory = "Content"
  61.             '//LOAD GRAPHICS
  62.             Mapset = OurContent.Content.Load(Of Texture2D)("Content/Graphics/Tilesets/0")
  63.  
  64.             retValue = True
  65.  
  66.         Catch ex As Exception
  67.             retValue = False
  68.               MessageBox.Show(ex.Message)
  69.         End Try
  70.  
  71.         Return retValue
  72.     End Function
  73.  
  74.  
  75. End Module

Use the apropriate Texture2D object for the SpriteBatch and GraphicsDevice that you are drawing to. (Tileset with SBatch_TILESET and Mapset with SBatch_MAP)
Code:
Public Sub NewMap()

    GDevice_TILESET.Clear(Color.Black)
    SBatch_TILESET.Begin()
    SBatch_TILESET.Draw(Tileset, New Rectangle(0, 0, 32, 32), New Rectangle(0, 0, 32, 32), Color.White)
    SBatch_TILESET.End()
    GDevice_TILESET.Present()

    GDevice_MAP.Clear(Color.Black)
    SBatch_MAP.Begin()
    SBatch_MAP.Draw(Mapset, New Rectangle(0, 0, 32, 32), New Rectangle(0, 0, 32, 32), Color.White)
    SBatch_MAP.End()
    GDevice_MAP.Present()

End Sub
Thanks, guess it worked!