0

The exception is:

Unhandled exception at 0x6474f269 in Loliboll.exe: 0xC0000005: Access violation reading location 0x0000000c.

I think it's a memory leak.

I tried to solve it obviously, but to no prevail.

This is the code:

#include "stdafx.h"

using namespace std;


int main()
{
//	FreeConsole();

	int a;

//	INTRO = 1;
//	MENU = 2;
//	INGAME = 3;

	elf_handle gui = elfCreateTextureFromFile("startup.png");
	elfSetGui(gui);
    elfInitWithConfig("config.txt");

  elf_handle scn = elfLoadScene("level1.pak");
	elf_handle cam = elfGetCameraByName(scn, "Camera");

	elf_handle tex = elfCreateTextureFromFile("startup.jpg");
	elf_handle pic = elfCreatePicture("MyPicture");
	elfHideMouse(true);

	
	//Sets the default state to be the intro state.

	a = 1;

	elf_handle timer = elfCreateTimer();
	elfStartTimer(timer);
	elfSetPictureTexture(pic, tex);
	elfAddGuiObject(gui, pic);

    while(elfRun())
    {a
		
		if (a == 1)
		{
			if(elfGetElapsedTime(timer) > 5.0)
				elfSetGuiObjectVisible(pic, false);
				a = 2;
		}
		
		if (a == 2)
		{
		}

		if (a == 3)
		{
		}
		
    }

    elfDeinit();

    return 0;

}

By the way, there are no errors or warnings, i solved those.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by template<>
0

It would be good practice to always check your return codes. If you do so, you will most likely find your error.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.