Exemplo n.º 1
0
struct VirtualStream * createVirtualStream(char * filename)
{
  //Allocate a virtual stream structure
  struct VirtualStream * newstream = (struct VirtualStream *) malloc(sizeof(struct VirtualStream));
  if (newstream==0)  {  fprintf(stderr,"Cannot allocate memory for new stream\n"); return 0; }


  //Clear the whole damn thing..
  memset(newstream,0,sizeof(struct VirtualStream));

  if (filename!=0)
  {

  fprintf(stderr,"strncpy from %p to %p \n",filename,newstream->filename);
   //strncpy(newstream->filename,filename,MAX_PATH);
     myStrCpy(newstream->filename,filename,MAX_PATH);
  fprintf(stderr,"strncpy returned\n");

   if (!readVirtualStream(newstream))
    {
      fprintf(stderr,"Could not read Virtual Stream from file %s \n",filename);
      destroyVirtualStream(newstream);
      return 0;
    }
  } else
  {
    fprintf(stderr,"Created an empty virtual stream\n");
  }

  return newstream;
}
Exemplo n.º 2
0
int closeScene()
{
  stopOGLRendering();

  deallocateModelList(modelStorage);

  unsigned int i=0;
  //Object 0 is camera
  for (i=1; i<scene->numberOfObjectTypes; i++)
    {
//       unloadModel(models[i]);
    }
  //free(models);

  destroyVirtualStream(scene);

  return 1;
}