Gang Tang | 2 Jul 08:38

Question: how to use chinese ttf file in agar?

Dear all,

I am ready to use agar in my project,  I am in China,
and want to render Chinese using msyh.ttf (which is a
beautiful vector Chinese font file released by Microsoft).

At this moment, I am working under debian lenny linux
with UTF8 as default system environment code. here I
want to ask:

1. How to load an existing ttf file from file system in agar?
    which API?
2. Does agar support UTF8 char code? I know freetype
    support it.

emm, that's all this time. Anybody can help me?

Thank you!
Robert Wakefield | 30 Jun 01:57
Favicon

VS2003 build problem: _AG_WindowNew not in lib

I'm trying to use Agar on Windows XP, building from source on Visual Studio
2003.  The libraries and dlls finish building, but I get a number of warnings
for multiply defined symbols in the libraries, along the lines of:

ag_gui.lib(ag_gui.dll) : warning LNK4006: __imp__AG_CopyProp already defined in
ag_core.lib(ag_core.dll); second definition ignored

When I try to run the sample 'Hello World' program, I get unresolved externals
for _AG_WindowNew, _AG_WindowShow, and _AG_LabelNewStatic.  I have looked in the
library files, and all the 'multiple definition' warning functions indeed appear
in both .lib files.  Some others are missing (the above _AG_LabelNewStatic, etc)
while others, like _AG_InitGUI, make it into the libary with no problem.  Do you
have any idea how to resolve this.

I did try the prebuilt libs, but got an unresolved external __ftol2_sse, which
from what I could find means I need to build my own lib copies.
Eric Dunstan | 24 Jun 11:50
Favicon

A Simple Agar Application with a text area

Here is my simple AGAR application that compiles and runs with Agar 1.3.3 with
no problem. This is implemented in C only. It is called main.c

I used this code to compile agains Agar compiled from source via SVN
repositories revision 8209, the latest, and it fails, but the error messages
point to the AGAR code itself.

#pragma comment(lib,"PthreadVC2.lib")

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

#include <string.h> 

static void
DisableInput(AG_Event *event) 
{
	AG_Textbox *textbox = AG_PTR(1); 
	int flag = AG_INT(2);

	if (flag) {
		AG_WidgetDisable(textbox);
	} else {
		AG_WidgetEnable(textbox);
	}
}

int
main(int argc, char *argv[])
{
(Continue reading)

Eric Dunstan | 24 Jun 11:33
Favicon

VS2008 Errors when compiling Agar r8209 applications

compilation of the latest revision of Agar 8209 from source code 
via SVN succeeds. 

But when using the resulting headers and lib files in a simple Agar 
application, 
without Word Wrapping yet, in Visual Studio 2008 Express, 
it produces the following error message. 
However, Visual Studio 2008 Express successfully compiles the exact 
same simple code using the headers and libraries of 
Agar 1.3.3 released version.

Here is the error message:

1>------ Build started: Project: Agar2008inC, Configuration: 
Debug Win32 ------
1>Compiling...
1>main.c
1>c:\program files\agar\agar-8209\include\agar\core\error.h(61) :
 error C2061: syntax error : identifier '__attribute__'
1>c:\program files\agar\agar-8209\include\agar\core\error.h(61) :
 error C2059: syntax error : ';'
1>c:\program files\agar\agar-8209\include\agar\core\error.h(61) :
 error C2059: syntax error : ','
1>c:\program files\agar\agar-8209\include\agar\core\error.h(61) :
 error C2143: syntax error : missing ')' before 'constant'
1>c:\program files\agar\agar-8209\include\agar\core\error.h(61) :
 error C2143: syntax error : missing ')' before 'constant'
1>c:\program files\agar\agar-8209\include\agar\core\error.h(64) :
 error C2061: syntax error : identifier '__attribute__'
1>c:\program files\agar\agar-8209\include\agar\core\error.h(64) :
(Continue reading)

Eric Dunstan | 24 Jun 10:21
Favicon

Patch for configure to work with perl for compiling agar source

Here is a patch for running ./configure on a checked out repository of Agar. I
used ActivePerl perl, v5.10.0 built for MSWin32-x86-multi-thread. I used MinGW
and MSYS to compile AGAR.

The bug was that ./configure would fail, and if run again it would give a false
success message. The reason it would fail was that the path to the header file
passed to the perl program was of the form: "'./ada-core/ctxt.h'" and so I strip
out the outer "'" characters and it works. So you can do
../configure && make && make install, and it will compile.

perl mk/gen-declspecs.pl "'./ada-core/ctxt.h'"  #this fails
perl mk/gen-declspecs.pl './ada-core/ctxt.h'  #this works
perl mk/gen-declspecs.pl "./ada-core/ctxt.h"  #this works

The patch makes all three above work.

Before you apply the patch, it might be better to root out the problem from its
source and try to find out why those "'" characters are attached to the path in
the first place. Also, this patch is really just a simple hack to make it work.
There is probably a better way to accomplish the same effect more efficiently. 

Eric

Index: mk/gen-declspecs.pl
===================================================================
--- mk/gen-declspecs.pl	(revision 8209)
+++ mk/gen-declspecs.pl	(working copy)
@@ -72,6 +72,19 @@
 	exit(1);
 }
(Continue reading)

Tiago Vieira | 19 Jun 13:39

possible bug on fixed (agar 1.3.3/svn).

Hello,

I am trying to run a simple agar application which has only a button
attached on a fixed attached on a window. The problem is that the
button does not receive window-mousebuttondown event. When a attach
button to window directly it receives the event normaly (see attached
source code). It happens in agar 1.3.3 and in svn. In agar 1.3.2 it
works fine.
It is the new fixed behavior or it is a known/new bug?

Thanks in advance and sorry for my english.
Tiago Vieira M. Justino.
Attachment (butt.c): text/x-csrc, 643 bytes
_______________________________________________
Agar mailing list
Agar@...
http://libagar.org/lists.html
Mark Dunstan | 15 Jun 23:54

Word wrapping AG_Textbox

We are trying to enable word wrapping in AG_Textbox but, haven't been successful.

Summary:
There is a method listed in the below link to enable/disable word wrap but, it
doesn't work:
http://libagar.org/mdoc.cgi?man=AG_Textbox.3

Details of the error:
void AG_TextboxSetWordWrap (AG_Textbox *textbox, int enable)
....
AG_TextboxSetWordWrap() enables/disable word wrapping. 

However, in the include file:
#include <agar/gui/textbox.h>
textbox.h, it does not have this declaration but it does have:

#define AG_TEXTBOX_NO_HFILL      0x02000

but this does nothing.

And any call to AG_TextboxSetWordWrap(textbox, 1);

produces this error:
....
1>d:\cpp_apps\agar2008inc\agar2008inc\main.c(78) : warning C4013:
'AG_TextboxSetWordWrap' undefined; assuming extern returning int
....
1>main.obj : error LNK2019: unresolved external symbol _AG_TextboxSetWordWrap
referenced in function _SDL_main
1>D:\cpp_apps\Agar2008inC\Debug\Agar2008inC.exe : fatal error LNK1120: 1
(Continue reading)

Chris | 11 Jun 01:17

wanting printf to write to textbox buffer, but not overwrite

I have a chat box example that I need help with.

I have a chat box submit text to another disabled chat box in order to display
the chat. The problem is, when I use AGAR's printf function, it overwrites the
buffer, therefore deleting previous messages. How can I save previous messages
in the buffer and display the new ones as well?

Thanks in advance,
Chris
Paulo Pinheiro | 2 Jun 22:13

Agar with -g3

Hello,

What is the easiest way to compile agar with -g3(gdb) cflags in it? I tried to put it on the makefile but did not worked. I know it`s a silly question, but i`m a beginner. thanx in advance.

--
Paulo Victor de Almeida Pinheiro
------------------------------
Laboratório de Redes de Comunicação e  Segurança da Informação - LARCES
Mestrado em Ciência da Computação - UECE

_______________________________________________
Agar mailing list
Agar@...
http://libagar.org/lists.html
Chris | 2 Jun 02:44

How do I close a window?

I have an SDL application, and I am trying to use Agar as it's gui. My problem
is this:

I call a textbox for user input (username and password) and when they press
submit, I want to close that textbox and return the focus back to my SDL surface
for further rendering. How can I do this?
Samuel Crow | 1 Jun 02:11
Favicon

Re: Running agar with SDL + OpenGL app


Hello Carlos,

Actually it IS using SDL internally.  You shouldn't have to do anything special to use SDL in version 1.3.3 . 
In version 1.4 things will be different though.  Agar encapsulates the SDL functionality in its own functions.

--Sam

----- Original Message ----
> From: Carlos Yaque <iistarion@...>
> To: Samuel Crow <samuraileumas@...>
> Sent: Sunday, May 31, 2009 5:49:45 PM
> Subject: Re: [Agar] Running agar with SDL + OpenGL app
> 
> I've been looking this example but it's not using SDL, so I'm not sure
> what to do. In my code I initialize SDL, and then the agar library.
> The problem is that I dont know if I have to initialize anything else,
> and what to do to render the gui elements, whether I have to set the
> gl matrixes properly, if the rendering functions have to be inside my
> "render" function...
> 
> In fact it's a little bit frustrating going through the documentation,
> it has almost no info on what to do and which order :S
> 
> 2009/5/31 Samuel Crow :
> >
> > Hello Froilan,
> >
> > Look at the example in agar-1.3.3/demos/glview/ as a reference.  It is not 
> compiled by default when you build the package source so you'll probably have to 
> run its configure script.
> >
> >
> > --Sam
> >
> > ----- Original Message ----
> >> From: Froilan 
> >> To: agar@...
> >> Sent: Sunday, May 31, 2009 9:20:57 AM
> >> Subject: [Agar] Running agar with SDL + OpenGL app
> >>
> >> I'm trying to use Agar with my own SDL application. I just don't know what to
> >> do, although I tried lots of things. I've done the typical initialization:
> >>
> >> AG_InitCore("myapp", 0)!=-1
> >> AG_InitVideoSDL(window, AG_VIDEO_OPENGL)!=-1
> >>
> >> But then I just dont know what I've to do... Can anyone help me? I just need 
> a
> >> simple example like drawing some text, since I don't know what else do I need 
> to
> >> draw the gui on my window.
> >> I have my own loop and the typical drawing function where I write my ogl 
> calls.
> >>
> >> Thanks in advance!
> >>
> >> _______________________________________________
> >> Agar mailing list
> >> Agar@...
> >> http://libagar.org/lists.html
> >
> >
> >
> >
> >

Gmane