Jump to content

Recommended Posts

Posted

Hello Josh, i still got same error.

 

Message 0 and crash. I am using only one world at this moment, i will try it with another specialy for emitter.

 

EDIT: if i use another world for emmiters .. no message, no error and no emitter visible :)

-= Phenom II X4 965 3.4Ghz - ATI HD5870 - 6 GB DDR3 RAM - Windows 8 Pro 64x=-

Website: http://www.flamewarestudios.com

Posted

This works fine:

//	====================================================================
//	This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard
//	Written by Rimfrost Software
//	http://www.rimfrost.com 
//	====================================================================

#include "engine.h"

int WINAPI WinMain( HINSTANCE hInstance,
				HINSTANCE hPrevInstance,
				LPSTR lpCmdLine,
				int nShowCmd ) 
{
Initialize() ;
RegisterAbstractPath("C:/Leadwerks Engine SDK");
SetAppTitle( "test" ) ;
Graphics( 800, 600 ) ;
AFilter() ;
TFilter() ;

TWorld	world;
TBuffer gbuffer;
TCamera camera;
TMesh	mesh;
TLight	light;
TMesh	ground;
TMaterial material;

world = CreateWorld() ;
if (!world) {
	MessageBoxA(0,"Error","Failed to create world.",0);
	return Terminate();
}

gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);

camera=CreateCamera();
PositionEntity(camera,Vec3(0,0,-2));

material=LoadMaterial("abstract::cobblestones.mat");

CreateEmitter(50);

mesh=CreateCube();
PaintEntity(mesh,material);

ground=CreateCube();
ScaleEntity(ground,Vec3(10,1,10));
PositionEntity(ground,Vec3(0,-2,0));
PaintEntity(ground,material);

light=CreateDirectionalLight();
RotateEntity(light,Vec3(45,45,45));

// Game loop
while( !KeyHit() && !AppTerminate() )
{
	if( !AppSuspended() ) // We are not in focus!
	{
		// Rotate cube
		TurnEntity( mesh, Vec3( 0.5f*AppSpeed() ) ) ;

		// Update timing and world
		UpdateAppTime();
		UpdateWorld(AppSpeed()) ;

		// Render
		SetBuffer(gbuffer);
		RenderWorld();
		SetBuffer(BackBuffer());
		RenderLights(gbuffer);

		// Send to screen
		Flip(0) ;
	}
}

// Done
return Terminate() ;
}

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...