Example #1
0
void wsInit(const char* filename)
{
		// Init memory emulation
	memInit(filename);
		// Init GPU
	gpuInit();
		// Init I/O emulation
	ioInit();
		// And reset everything
	wsReset();
}
Example #2
0
void initServices()
{
    hidInit();
    sdmcInit();
    gfxInitDefault();
    consoleInit(GFX_BOTTOM, NULL);

//    gfxInit(GSP_RGBA8_OES,GSP_BGR8_OES,false);
//    gfxInit(GSP_BGR8_OES,GSP_BGR8_OES,false);

    printf("Initializing the GPU...\n");
    gpuInit();
    printf("Done.\n");
	printf("This App is a modded version of 3Damnesic, by Dr.Hacknik.\n");
}
Example #3
0
void 		GLimp_Init( void )
{
	gpuInit();
	glConfig.vidWidth = 400;
	glConfig.vidHeight = 240;
	glConfig.colorBits = 32;
	glConfig.depthBits = 24;
	glConfig.deviceSupportsGamma = qfalse;
	glConfig.displayFrequency = 60;
	glConfig.windowAspect = 400.0f / 240.0f;
	glConfig.maxActiveTextures = 3;
	ri.Cvar_Set("r_picmip", "2");
	qglLockArraysEXT = glLockArraysEXT;
	qglUnlockArraysEXT = glUnlockArraysEXT;
	qglActiveTextureARB = glActiveTexture;
	qglClientActiveTextureARB = glClientActiveTexture;

	ctr_rend_init();
	// Bind the shader program
	glUseProgram(0);

	gpuClearBuffers(CLEAR_COLOR);

	gpuFrameBegin();

	// Configure the first fragment shading substage to blend the texture color with
	// the vertex color (calculated by the vertex shader using a lighting algorithm)
	// See https://www.opengl.org/sdk/docs/man2/xhtml/glTexEnv.xml for more insight
	GPU_SetTexEnv(0,
		GPU_TEVSOURCES(GPU_TEXTURE0, GPU_PRIMARY_COLOR, GPU_PRIMARY_COLOR), // RGB channels
		GPU_TEVSOURCES(GPU_TEXTURE0, GPU_PRIMARY_COLOR, GPU_PRIMARY_COLOR), // Alpha
		GPU_TEVOPERANDS(0, 0, 0), // RGB
		GPU_TEVOPERANDS(0, 0, 0), // Alpha
		GPU_MODULATE, GPU_MODULATE, // RGB, Alpha
		0xFFFFFFFF);
	GPU_SetDummyTexEnv(1);
	GPU_SetDummyTexEnv(2);
	GPU_SetDummyTexEnv(3);
	GPU_SetDummyTexEnv(4);
	GPU_SetDummyTexEnv(5);

	// Load the texture
	//glGenTextures(1, &g_tex_id);
	//glBindTexture(0, g_tex_id);
	//glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, kitten_bin);
}
Example #4
0
int main()
{
	// Initialize graphics
	gfxInitDefault();
	gpuInit();

	// Initialize the scene
	sceneInit();
	gpuClearBuffers(CLEAR_COLOR);

	// Main loop
	while (aptMainLoop())
	{
		gspWaitForVBlank();  // Synchronize with the start of VBlank
		gfxSwapBuffersGpu(); // Swap the framebuffers so that the frame that we rendered last frame is now visible
		hidScanInput();      // Read the user input

		// Respond to user input
		u32 kDown = hidKeysDown();
		if (kDown & KEY_START)
			break; // break in order to return to hbmenu

		// Render the scene
		gpuFrameBegin();
		sceneRender();
		gpuFrameEnd();
		gpuClearBuffers(CLEAR_COLOR);

		// Flush the framebuffers out of the data cache (not necessary with pure GPU rendering)
		//gfxFlushBuffers();
	}

	// Deinitialize the scene
	sceneExit();

	// Deinitialize graphics
	gpuExit();
	gfxExit();
	return 0;
}