Talk:GRRLIB/Archive 1

From WiiBrew
Jump to: navigation, search

There are a few things which need to be pointed out. (sepp256)

- Since you are using (renamed) functions from SoftDev, you need to credit him.
- This should not be called a GX rendering lib because you are doing all of your rendering 
  into your own framebuffer and then just using GX to scale it into the xfb.  All of your 
  rendering functions (point, line, rectangle, texture) are software rendering into your framebuffer.
  (Which is horribly inefficient.)
- The reason things are blurry is because you're rendering into your framebuffer first.  
  All of those objects should be sent through GX.
- In general, for now people should probably be pointed to gx_supp.c/gx_supp.h by SoftDev from VBA 
  for some easy RGB fb->xfb scaling routines using GX.

here is my answer (nonameno)

- Credit are already on the wiki page !
- GX rendering lib, coz it's a "little" lib that convert a rgb buffer by the help of GX ;)
- this lib is not for confirmed devers, but for noobs, or people that want code easily quick applications ;)

Further comments (sepp256)

- Thank you for referencing SoftDev - you should state directly where they're pulled from, too
  (i.e. gx_supp.c/.h in VBA-GCE), so people know where to look.
- What would be a whole lot more helpful (for noobs) would be writing a set of high-level functions that 
  just wrap the GX functionality (draw line, point, rectangle, etc).
- This 'lib' really shouldn't be used by anyone unless/until it does some things like using hardware rendering, 
  defines some useful structs like for color, etc...

My statment (nonameno)

- Feel free to help me/us to make a funny and full intelligent simple library like we intend to provide ;)
And like this i will be also able to learn how to do all you said ;)

Converter

I feel the converter php scripts need to be

ported into windows apps, and of course linux

very few users would like to install php + the extra libs needed to use this convertor software :/ GizmoTheGreen

I did my own converter for Windows, if you are interested check this page. - Crayon 17:39, 5 June 2008 (CEST)

Blurry

For my it's blurry too (using HDBoxPro + TFT monitor @ 1440x900), don't know if it's due to the TFT monitor, with comercial games it's get a very bit blurry (due to scaling) but not as with GRRLIB. I'm good at maths, don't know if you need help at some points or there's something I could do. I thougth in implementing a pathfinding algorithm (based in walk-boxes, like SCUMM) to GRRLIB but i don't think it would be very usefull for normal coders (I'm using it on my own project) perhaps some functions as if a point is in a triangle (convex polygon) or the nearest point of an outside point to a polygon could be usefull. _CONEJO

Changelog

It will be cool if the lib provides a changelog. - skorianez 23 June 2008.

Freetype Font Rendering

Image:Grrfreetype.zip contains a simple freetype engine for use with GRRLIB.

Discussion about GRRLIB 2.0 and under

Transparency

GRRLIB defines GRRLIB_magenta=0xf01e as CMYK 0/100/0/3 I get 0xf81f for real magenta (CMYK 0/100/0/0) Is this supposed to be like that or a wrong value?

~miom

GRRLIB_ScrShot()

Coded by feesh.

void GRRLIB_ScrShot(char* file, char raw){
	// Usage:
	// GRRLIB_ScrShot("file.grr",1);
	// GRRLIB_ScrShot("file.pnm",0);
	if(!fatInitDefault())
		return; // Not very nice notifying the user like that </sarcasm>
	FILE *scrsht = fopen(file,"wb");
	if(!scrsht)
		return;
	if(raw)
	{
		fwrite(GRRLIB_buffer,1, 640*480*2, scrsht); // So simple!
	}
	else
	{
		/* PNM Format - Simple format, saves hassle of online conversion - Gimp opens these */	
		fwrite("P6\n",1,3,scrsht);			//
		fwrite("640 480\n",1,8,scrsht);	// PNM Header 
		fwrite("255\n",1,4, scrsht);		//
		int y, x;
		unsigned char *screen_buf = (unsigned char *)GRRLIB_buffer;
		for(y=0;y<480;y++)
		{
			for(x=0;x<640*2;x+=2)
			{
				// Convert back to 24 bit colour (888 from 565)
				unsigned char cols[3];
				cols[0] = (((screen_buf[y*640*2+x] >> 3)*255)/31);
				cols[1] = ((((((screen_buf[y*640*2+x]) & 0x07)<< 3) | (screen_buf[y*640*2+x+1]) >> 5))*255)/63;
				cols[2] = (((screen_buf[y*640*2+x+1]) & 0x1F)*255)/31;
				fwrite(cols,1, 3, scrsht);
			}
		}
	}
	fclose(scrsht);
	if(!fatUnmount(PI_INTERNAL_SD))
	{
		fatUnsafeUnmount(PI_INTERNAL_SD);
		// I can only hope it's better than nothing
	}
}