unit types3d;
interface
uses opengl;

TYPE //tu sa uklada textura; na pouzivanie je treba zavolat SetLength(Textura.Data,Width*Height*BPP);
     //bod zo suradnicami [X,Y] ma potom farbu Textura.Data[Y*Width+X] v pripade 1 byte textury alebo
     //Textura.Data[(Y*Width+X)*BPP+FAREBNY_KANAL_INDEXOVANY_OD_NULA]
     TTexture = RECORD
       Data: Array of GLubyte; Width,Height,BPP,ID: GLint;
     END;

     TCoord2d = RECORD
      X,Y: GLfloat;
     END;

     TCoord3d = RECORD
      X,Y,Z: GLfloat;
     END;

     TTexCoord = RECORD
      U,V: GLfloat;
     END;

     //nacitavanie windows bitmap (preto BGR) pomocou scanline
     TRGB = Record
      B,G,R: Byte;
     End;
     RGBVal = Array[Word] of TRGB;
     RGBLine = ^RGBVal;

procedure glGenTextures(n: GLsizei; var textures: GLuint); stdcall; external 'opengl32.dll';
procedure glBindTexture(target: GLenum; texture: GLuint); stdcall; external 'opengl32.dll';
procedure glDeleteTextures(n: GLsizei; textures: PGLuint); stdcall; external 'opengl32.dll';
procedure glCopyTexImage2D(target: GLenum; level: GLint; internalFormat: GLenum; x, y: GLint; width, height: GLsizei; border: GLint); stdcall; external 'opengl32.dll';
procedure glCopyTexSubImage2D(target: Cardinal; level: GLuint; xoffset: GLuint; yoffset: GLuint; x: GLuint; y: GLuint; width: GLuint; height: GLuint); {$IFDEF Win32} stdcall; {$ENDIF} {$IFDEF LINUX} cdecl; {$ENDIF} external 'opengl32.dll';

implementation

end.
