Trouble with iMiniB3D

BlitzMax Forums/MiniB3D Module/Trouble with iMiniB3D

apamment(Posted 2013) [#1]
Hi

I'm trying to learn iMiniB3D. I've got it to compile and imported the library into XCode, and started writing my program, but every time I try and test it, it crashes in UpdateWorld saying "incorrect checksum for freed object - object was probably modified after being freed."

I know it should work, the birds demo works fine, so it's obviously something I'm doing wrong.

My code:


#include "game.h"

void Game::Init() {

    
    Global::Graphics();
    
    LoadLevel();
    
}

void Game::Run() {
    
    Global::UpdateWorld();
    Global::RenderWorld();
}

void Game::End() {
    Global::ClearWorld();
}

void Game::LoadLevel() {
    //Global::ClearWorld();
    
    Light *light;
    
    scene = Pivot::CreatePivot();
    scene->PositionEntity(0, 0, 0);
    light = Light::CreateLight(1, scene);
    light->RotateEntity(90, 0, 0);
    
    player = Camera::CreateCamera();
  
    player->CameraRange(0.2, 1000);
    player->EntityRadius(0.75);
//    player->1
//    CameraRange (lvl.player , 0.2 , 1000)
//    EntityRadius(lvl.player , 0.75)
//    EntityType(lvl.player , type_camera)
//    EntityPickMode(lvl.player , 3)
    
    Mesh *cube = Mesh::CreateCube(scene);
    cube->PositionEntity(10, 0, 0);
}


The code for AppDelegate and EAGLView are copied from the iMiniB3D examples.

Could it be some flag in the build settings I should toggle?


ima747(Posted 2013) [#2]
Are you sure init is being called? Personally whenever I run into bugs that don't make sense I start throwing NSLog's everywhere to make sure that things are happening in the order expected. i.e. are you 100% sure init() is being called *before* the first call to run()?


apamment(Posted 2013) [#3]
thanks! it seems i wasnt doing that. its fixed now and i see my cube :D