Datagrid segmentation problem

Help with integrating libRocket into your engine and game

Datagrid segmentation problem

Postby miccerisier on Sun Aug 18, 2013 2:16 am

Hello,

I have a big trouble with the usage of datagrid. When I try to add value, my program crashes in the rendering part. I do not understand why. In Geometry.cpp line 91 or 194 (i don't know exactly)

The technical informations:
I develop a game engine for my videogame. The engine is in C++ and the game logic in python. Librocket is init in the C++ part, but use in the python part.
Code: Select all
class FileDS(rocket.DataSource):
   def __init__(self, name):
      rocket.DataSource.__init__(self, name)
      self.tab = []

   def GetNumRows(self, table):
      print table
      if table == "files":
         return len(self.tab)
      else:
         return 0

   def GetRow(self, table, row_index, colums):
      row = []
      for col in colums:
         if col == "name":
            row.append(self.tab[row_index])
      return row

   def clear(self, cmd = None):
      self.tab = []

   def addLayer(self, cmd):
      self.tab.append(cmd.strings[0])
      self.NotifyRowAdd("files", len(self.tab) - 1, 1);

If I call addLayer my game crashes. If someone can help me, it would be really nice :D.

Regards.
miccerisier
 
Posts: 4
Joined: Thu Mar 14, 2013 6:59 am

Re: Datagrid segmentation problem

Postby miccerisier on Wed Aug 28, 2013 11:25 am

Hi,

If nobody understands my problem, someone can show me an example of code that works in python?

Regards.
miccerisier
 
Posts: 4
Joined: Thu Mar 14, 2013 6:59 am


Return to Engine Integration


cron