problem with creating a skybox

7 views
Skip to first unread message

xing xiaoxiong

unread,
Dec 28, 2011, 12:57:15 AM12/28/11
to G3D Users
I am using G3D 9.0 beta 3 version and started with the
tinyStarter.sln.

I added the following line
Texture::Ref skyBox;
in the definition of class App.

then in the function App::onInit(), I added
skyBox->fromFile("media/env_*.jpg", ImageFormat::AUTO(),
Texture::DIM_CUBE_MAP, Texture::Settings::cubeMap());

then in App::onGraphics3D(...), I added
Draw::skyBox(rd, skyBox);

After running the program, an error occurred, saying

"Assertion Failure - tinyStart.exe
Dereferenced a NULL ReferenceCountedPointer
Expression: m_pointer != NULL
g:\g3d9b3\include\g3d\referencecount.h:365"

How to solve this problem?

xing xiaoxiong

unread,
Dec 28, 2011, 12:59:20 AM12/28/11
to G3D Users
my environment images were put under the file folder "media", which
was placed at the same directory with the .sln file.

xing xiaoxiong

unread,
Dec 28, 2011, 1:25:48 AM12/28/11
to G3D Users
I found the answer, I should have used skyBox = Texture::fromFile(...)
rather than skyBox->fromFile(...);
Reply all
Reply to author
Forward
0 new messages