Пример #1
0
BOOL View::InitGL()
{
	glShadeModel(GL_SMOOTH);
	glClearColor(0.f, 0.f, 0.f, 1.f); //Initialize Background Colour
	glEnable(GL_DEPTH_TEST); //Enable Depth Test
	glDepthFunc(GL_LEQUAL); //If the image is closer to camera, allow it to be ontop
	glEnable(GL_CULL_FACE); //Allow culling of faces
	glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); //Allows the interior of polygon to be filled
	glEnable(GL_BLEND); //Allow blending of textures with alpha
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //Alpha stuff
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Nicest Perspective that can be calculated
	glfwSwapInterval(0);

	glGenVertexArrays(1, &m_vertexArrayID);
	glBindVertexArray(m_vertexArrayID);

	if (!InitProgramInfo())
	{
		std::cout << "Failed to Load Program Parameters" << std::endl;
	}
	if (!InitLightsInfo())
	{
		std::cout << "Failed to Load Lights" << std::endl;
	}

	this->theModel->Init();

	return TRUE;
}
Пример #2
0
int main(int argc, char **argv)
{
	Object *code, *pm;
	Object *prog, *objv[2];
	Stream *s, *strv[4];
        char   *dummy = Null(char);
	word e;
#if 0
	MCB m;
#endif
	Environ env;

	if( argc < 2 ) 
	{
		printf("usage: bounce machine [msgsize [bounces]]\n");
		return 20;
	}

	msgsize = argc<3?1024:atoi(argv[2]);
	bounces = argc<4?5000:atoi(argv[3]);
	
	if( strcmp("remote",argv[0]) != 0 )
	{
		int i;

		MachineName(mcname);
		i = strlen(mcname);
		while(mcname[--i] != c_dirchar);
		mcname[i+1] = '\0';
		strcat(mcname,argv[1]);
		strcat(mcname,"/tasks");

		pm = Locate(CurrentDir,mcname);

		code = Locate(CurrentDir,"/loader/bounce");

		prog = Execute(pm,code);

		s = Open(prog,NULL,O_WriteOnly);

		objv[0] = CurrentDir;
		objv[1] = Null(Object);

		strv[0] = Heliosno(stdin);
		strv[1] = Heliosno(stdout);
		strv[2] = Heliosno(stderr);
		strv[3] = Null(Stream);

		argv[0] = "remote";
		env.Argv = argv;
		env.Envv = &dummy; 
		env.Objv = &objv[0];
		env.Strv = &strv[0];
	
		e = SendEnv(s->Server,&env);

		echo(prog->Reply);

#if 0
		InitMCB(&m,0,prog->Reply,NullPort,0);
		m.Timeout = MaxInt;

		e = GetMsg(&m);
#else
		InitProgramInfo(s,PS_Terminate);
		e = GetProgramInfo(s,NULL,-1);
#endif
		Close(code);
		Close(prog);
		Close(s);
		Close(pm);
	}
	else {
		bounce(MyTask->Parent,MyTask->Port);	
	}	

	return 0;
}