Sorry, adding attachments.

On 2010-10-27 17:40, Fabian Svara wrote:
Hi,

there's a problem with the AG_Console where it can become
impossible to scroll down far enough to be able to read the
last line. This seems to be related to the '_' character being
present in the console messages. This seems to happen with
sdlfb and sdlgl only.

The attached code illustrates the problem and the screenshot
shows what the result looks like. The console contains 30
lines in the screenshot, but the last readable line is line 29.
The screenshot was generated by running ./console-bug -d sdlfb.

I submitted this to bugzilla #172.

Best regards,

Fabian Svara


_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

<<attachment: Screenshot-Console bug.png>>

#include <agar/core.h>
#include <agar/gui.h>

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char *argv[])
{
	AG_Window *win;
	AG_Console *cons;
	char *driverSpec = NULL, *optArg;
	int c, i;

	while ((c = AG_Getopt(argc, argv, "?hd:", &optArg, NULL)) != -1) {
		switch (c) {
		case 'd':
			driverSpec = optArg;
			break;
		case '?':
		case 'h':
		default:
			printf("Usage: console [-d agar-driver-spec]\n");
			return (1);
		}
	}

	if (AG_InitCore("Console bug", 0) == -1 ||
	    AG_InitGraphics(driverSpec) == -1) {
		fprintf(stderr, "%s\n", AG_GetError());
		return (1);
	}
 
	win = AG_WindowNew(0);

    /* These settings aren't necessary to trigger the problem
       but make it more obvious. */
    AG_WindowSetBottomBorder(win, 2);
    AG_WindowSetGeometryAligned(win, AG_WINDOW_MR, 300, 135);

	cons = AG_ConsoleNew(win, AG_CONSOLE_EXPAND);

	AG_WindowShow(win);

    for (i = 0; i <= 30; i++) {
        AG_ConsoleMsg(cons, "Line %d of 30: _", i);
    }

	AG_EventLoop();
	AG_Destroy();
	return (0);
}
_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to