Ver Mensaje Individual
  #31  
Antiguo 29-10-2007
Avatar de Héctor Randolph
[Héctor Randolph] Héctor Randolph is offline
Miembro Premium
 
Registrado: dic 2004
Posts: 882
Reputación: 22
Héctor Randolph Va por buen camino
Conseguí hacerlo funcionar en Delphi 7, aquí está la prueba

Para corregir el problema con los arreglos, la explicación que da la ayuda es la siguiente:

Cita:
[Error] title.pas(72): Array type required
[Error] title.pas(115): Array type required
Cita:
We try to apply an index to a pointer to integer - that would be legal in C, but is not in Delphi.

In The Delphi language, we must tell the compiler that we intend P to point to an array of integers.
A continuación pongo el código que tuve que modificar:

Código Delphi [-]
//  AL_DATAFILEptr = ^AL_DATAFILE;
  AL_DATAFILE = RECORD
    dat : AL_PTR;    { pointer to the data  }
    ftype : AL_INT;    { object type  }
    size : AL_INT;    { size of the object  }
    prop : AL_DATAFILE_PROPERTYptr; { object properties  }
  END;
  type
  TDataFile_Array = array [0..80] of AL_DATAFILE; // Se declara como un arreglo
  AL_DATAFILEptr =^TDataFile_Array; // Apuntador al arreglo



Código Delphi [-]
(* information about an entire joystick *)
//  AL_JOYSTICK_INFOptr = ^AL_JOYSTICK_INFO;
  AL_JOYSTICK_INFO = RECORD
    flags : AL_INT;
    num_sticks : AL_INT;
    num_buttons : AL_INT;
    stick : ARRAY [0..(AL_MAX_JOYSTICK_STICKS)-1] OF AL_JOYSTICK_STICK_INFO;
    button : ARRAY [0..(AL_MAX_JOYSTICK_BUTTONS)-1] OF AL_JOYSTICK_BUTTON_INFO;
  END;
type
  TJoyInfo_Array = array [0..100] of AL_JOYSTICK_INFO; // Se declara como un arreglo
  AL_JOYSTICK_INFOptr = ^TJoyInfo_Array; // Apuntador al arreglo

Por último envía un error en tiempo de ejecución en la línea que pone el título en la ventana, simplemente la comenté.

Código Delphi [-]
//al_set_window_title ('Allegro.pas Demo Game');

Ahora sí puedo intentar hacer algo con la librería.

Saludos.
Responder Con Cita