Bennu Game Development

English Forums => Extensions => Topic started by: l1nk3rn3l on June 05, 2008, 03:26:42 AM

Title: New Bennu DLL's
Post by: l1nk3rn3l on June 05, 2008, 03:26:42 AM
Bennu Gamepad library(adding support for joysticks, gamepads and steering wheels including Xbox360 gamepads)
http://www.fenixworld.com/e107_plugins//depot/files/fw92.joylib.rar


Bennu CPP template to create new Dll's
http://www.fenixworld.com/e107_plugins//depot/files/fw92.bennuplantillacpp.rar


Video Divx Bennu Library
http://www.fenixworld.com/e107_plugins//depot/files/fw92.bennuvideo.rar

Bennu3d
http://3dm8ee.blogspot.com/


Last bennu version is required :
http://bennupack.blogspot.com/
Title: Re: New Bennu DLL's
Post by: Sandman on June 05, 2008, 10:15:11 AM
Interesting stuff, this. Nice job.
Title: Re: New Bennu DLL's
Post by: SplinterGU on June 06, 2008, 03:40:20 AM
Una cuestion, en fenix el numero de los arrays indican hasta que indice llega el array, no la cantidad de elementos de array, por eso si ponemos a[10], indicara que a tiene 11 elementos, desde 0 hasta 10 inclusive.
Por eso hay un pequeño corrimiento entre las estructuras Fenix y C++ "MiControl". En fenix/Bennu, Button debe ser MAX_GAMEPAD_BUTTONS - 1, o sea, Button[MAX_GAMEPAD_BUTTONS-1].

EDIT: O algo se me esta escapando o algo esta mal en los arrays dentro de las estructuras... ya que en fenix el numero entre corchetes deberia indicar el numero de indice maximo, inclusive, no la cantidad como en C. Veo que tenes declaradas las 2 igual en C++ y en Bennu, no deberia coincidir...

EDIT (5 segundos despues...) :D : ya lo vi, le pasas 1 a 1 las estructuras a la funcion JOY_INIT_STRUCT, supongo que haces esto porque cuando lo hacias como array no iba...

  for (i=0; i<MAX_GAMEPADS; i++)
   JOY_INIT_STRUCT(i,&GamePad) ;
  end;

Bueno, si es por eso, el problema esta en lo que comente arriba. Saludos.
Title: Re: New Bennu DLL's
Post by: SplinterGU on June 06, 2008, 04:29:05 AM
aca pongo una modificacion del "test01 joy.prg" para poder testear todos los joys conectados, lo probe hasta con 3 joys... la lib funciona muy bien hasta donde probe.
Saludos

[code language="bennu"]/*
//------------------------------------------------
// JoyLib  Interface (c) 2004
// Colombian Developers
// License: GNU/GPL
//------------------------------------------------


Gamepad Extended Library

Support all DirectX compatible hardware
*/


include "joylib.h"

import "mod_key"
import "mod_string"

Global
    GamepadExist;//flag error
    NumeroControles;
    njoy=0;
    i;
    ii;
begin
    // full_screen=true;
    set_mode (640,480,16);

    GamepadExist = Init_Joy_Lib();

    if (GamepadExist <> 0)//ERROR?
        write (0, 40, 10, 0, "Gamepad not found...");
        while (not key(_esc)) frame; end;
    else
        write (0, 40, 10, 0, "DINPUT Init OK...");

        //TestJoy();
        NumeroControles= JOY_COUNT() ;

        write (0, 40, 20, 0, "Joystick Count: "+itoa(NumeroControles));

        write (0, 40, 50, 0, "FFB");
        write (0, 40, 60, 0, "AXIS_X");
        write (0, 40, 70, 0, "AXIS_Y");
        write (0, 40, 80, 0, "AXIS_Z");

        write (0, 40, 90, 0, "ROT_X");
        write (0, 40, 100, 0, "ROT_Y");
        write (0, 40, 110, 0, "ROT_Z");

        write (0, 40, 120, 0, "SLIDER1");
        write (0, 40, 130, 0, "SLIDER0");
        write (0, 40, 140, 0, "POV");

        for (i=0; i < MAX_GAMEPAD_BUTTONS; i++)
            write (0, 40, 150 + i*10, 0, "Button "+(i+1));
        end

        write (0, 40, 250, 0, "ID");

        for (ii=0; ii <NumeroControles;ii++)
            write (0, 120+ii*50, 40, 0, "Joy "+(ii+1));

            if (GamePad[ii].isForceFeedback==1)    //soporta vibracion?
                write (0, 120+ii*50, 50, 0, "yes");
            ELSE
                write (0, 120+ii*50, 50, 0, "no");
            END

            write_int(0, 120+ii*50, 60, 0, OFFSET GamePad[ii].x_AXIS);
            write_int(0, 120+ii*50, 70, 0, OFFSET GamePad[ii].y_AXIS);
            write_int(0, 120+ii*50, 80, 0, OFFSET GamePad[ii].z_AXIS);

            write_int(0, 120+ii*50, 90, 0, OFFSET GamePad[ii].x_ROT);
            write_int(0, 120+ii*50, 100, 0, OFFSET GamePad[ii].y_ROT);
            write_int(0, 120+ii*50, 110, 0, OFFSET GamePad[ii].z_ROT);

            write_int(0, 120+ii*50, 120, 0, OFFSET GamePad[ii].SLIDER1);
            write_int(0, 120+ii*50, 130, 0, OFFSET GamePad[ii].SLIDER0);
            write_int(0, 120+ii*50, 140, 0, OFFSET GamePad[ii].POV);

            for (i=0; i < 10; i++)
                write_int(0, 120+ii*50, 150 + i*10,  0,OFFSET GamePad[ii].Button);
            end

            write_int(0,120+ii*50, 250,  0, OFFSET GamePad[ii].id);
        end

        while (not key(_esc) )
            frame;
        end

    end //if

    //free libraries
    Unload_Joy_Lib();
end
[/code]
Title: Re: New Bennu DLL's
Post by: l1nk3rn3l on July 08, 2008, 02:03:35 PM
new bennu3d preview available

Title: Re: New Bennu DLL's
Post by: Coptroner on August 30, 2008, 12:54:35 AM
Buenas,
estoy probando la libreria de bennu video para hacer una intro en un juego.

Despues de diversas pruebas no consigo 2 cosas:
1.-Que no aparezca el puntero del mouse sobre la pantalla en FULLSCREEN.
2.-Al terminar la animación, Bennu no recupera el foco de pantalla y la aplicacion se minimiza dejando ver el escritorio al tiempo que el interprete sigue su marcha...

EDITADO:
Vale, por lo que veo, si lo ejecutamos en modo FULLSCREEN=FALSE; todo va bien, el problema que he comentado arriba es para cuando lo hacemos con FULLSCREEN=TRUE;

¿Como se puede arreglar eso?

GRACIAS
Title: Re: New Bennu DLL's
Post by: blostec on September 20, 2008, 03:04:52 PM

These DLL's are really very interesting. Thanks l1nk3rn3l   :D
Title: Re: New Bennu DLL's
Post by: HaCkZJuaNN on September 21, 2008, 09:52:29 AM
maybe its a nonsense, but this is the english forum, so it would be better to speak in english, just to allow the non spanish speakers to understand it :P
Title: Re: New Bennu DLL's
Post by: FreeYourMind on December 01, 2009, 08:18:33 PM
Hi (talking in english...  :().
I want to adapt the example to use in te same prg, the keys from Gp2x Wiz (this is complete, i don't need help for this) and the keys from my joystic using Bennu.

1 - First, this example is the best and simple way to do that ? exist another way using only mod_joy to put joystic working in the game ?

2 - I try to adapt the example and import 'JoyLib.h', the compiler get an error in line 23: "=" expected STRUCT.

I need an example to use the joystic for PC in Bennu, i use an PS2 joystic with USB adapter.
Using the complete mapper from Wiz keys, the key right from Wiz correspond with 3 keys of the joystic (R1, R2 and L1), the left key from Wiz correspond with another 3 keys of the joystic (box, X, circle), the triangle key, R2 and others, has no equivalent buttons from Wiz mappers.

Please help.
Thanks.
Title: Re: New Bennu DLL's
Post by: FreeYourMind on December 01, 2009, 09:51:33 PM
I find an example in Bennu Wiki: Joystick test code.
This example is the solution for my dubts, it works in the same way to Wiz, and i need to detect the SO, to put the mappers for Wiz buttons or PC Joystic buttons.
All resolved.

Thanks for your time if you read the posts ;)