Page 6 of 7 FirstFirst ... 4567 LastLast
Results 51 to 60 of 65

Thread: GLXTreem

  1. #51

    GLXTreem

    I think it's time to add a (new) "GLX section" under the PROGRAMMING section of the forum, don't you think?
    What echoes in Eternity has been done in someone's life...

  2. #52

    GLXTreem

    DrawRotate, has a bug that contaminated DrawRotateAdd. It follows the correction:

    //------------------------------------------------------------------------
    procedure TGLXImageItem.DrawRotate(X, Y, Width, Height, PatternIndex: Integer;
    CenterX, CenterY: Double; Angle: Integer);
    var Rect: TRect;
    RenderState: TGLXRenderState;
    begin

    glPushMatrix();
    glLoadIdentity();
    Rect.Left :=-Round( CenterX * Width );
    Rect.Top :=-Round( CenterY * Height);
    Rect.Right := Round((1-CenterX) * Width );
    Rect.Bottom:= Round((1-CenterY) * Height);
    glPopMatrix();

    RenderState:= GLXDraw.RenderState;
    GLXDraw.RenderState:=rs2D;
    glPushAttrib(GL_TEXTURE_BIT);
    glEnable(GL_TEXTURE_2D);
    Bind;

    glTranslate(X,Y,0);
    glRotate (Angle, 0,0,1);

    glBegin(GL_QUADS);
    with FPatterns[PatternIndex] do begin
    glTexCoord2f(Left , Bottom); glVertex2i(Rect.Left , Rect.Top);
    glTexCoord2f(Right, Bottom); glVertex2i(Rect.Right, Rect.Top);
    glTexCoord2f(Right, Top ); glVertex2i(Rect.Right, Rect.Bottom);
    glTexCoord2f(Left , Top ); glVertex2i(Rect.Left , Rect.Bottom);
    end;
    glEnd();
    glPopAttrib();
    GLXDraw.RenderState:=RenderState

    end;



    //------------------------------------------------------------------------
    procedure TGLXImageItem.DrawRotateAdd(X, Y, Width, Height, PatternIndex: Integer;
    CenterX, CenterY: Double; Angle: Integer; Alpha: Single);
    var Rect: TRect;
    RenderState: TGLXRenderState;
    begin

    glPushMatrix();
    glLoadIdentity();
    Rect.Left :=-Round( CenterX * Width );
    Rect.Top :=-Round( CenterY * Height);
    Rect.Right := Round((1-CenterX) * Width );
    Rect.Bottom:= Round((1-CenterY) * Height);

    glPopMatrix();

    glEnable(GL_BLEND);
    glColor4f(1.0,1.0,1.0,Alpha);
    glBlendFunc(GL_SRC_ALPHA,GL_ONE);;

    RenderState:= GLXDraw.RenderState;
    GLXDraw.RenderState:=rs2D;
    glPushAttrib(GL_TEXTURE_BIT);
    glEnable(GL_TEXTURE_2D);
    Bind;

    glTranslate(X,Y,0);
    glRotate (Angle, 0,0,1);

    glBegin(GL_QUADS);
    with FPatterns[PatternIndex] do begin
    glTexCoord2f(Left , Bottom); glVertex2i(Rect.Left , Rect.Top);
    glTexCoord2f(Right, Bottom); glVertex2i(Rect.Right, Rect.Top);
    glTexCoord2f(Right, Top ); glVertex2i(Rect.Right, Rect.Bottom);
    glTexCoord2f(Left , Top ); glVertex2i(Rect.Left , Rect.Bottom);
    end;
    glEnd();
    glPopAttrib();
    GLXDraw.RenderState:=RenderState;
    glDisable(GL_BLEND);

    end;

  3. #53

    GLXTreem

    SuperEly, wasn't the code:

    Rect.Left :=-Round( CenterX * PatternWidth );
    Rect.Top :=-Round( CenterY * PatternHeight);
    Rect.Right := Round((1-CenterX) * PatternWidth );
    Rect.Bottom:= Round((1-CenterY) * PatternHeight);

    from the beginning, what's the bug with that ??

    I have started rewritten the homepage is approx 40% done, when the page is ready the new version is released.


    Edit:

    Found what bug you ment, it's when the patternwidth or patternheight is 0 but the drawrotate funktion is correct, it in UpdatePatterns the bug was..
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  4. #54

    GLXTreem

    See the parameters of the procedure:

    DrawRotate(X, Y, Width, Height, PatternIndex: Integer;
    CenterX, CenterY: Double; Angle: Integer);

    Width and Height are not used like this:

    Rect.Left :=-Round( CenterX * PatternWidth );
    Rect.Top :=-Round( CenterY * PatternHeight);
    Rect.Right := Round((1-CenterX) * PatternWidth );
    Rect.Bottom:= Round((1-CenterY) * PatternHeight);

    But they are used like this:

    Rect.Left :=-Round( CenterX * Width );
    Rect.Top :=-Round( CenterY * Height );
    Rect.Right := Round((1-CenterX) * Width );
    Rect.Bottom:= Round((1-CenterY) * Height );


  5. #55

    GLXTreem

    :roll:
    Well, what can i say, stupid me =)
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  6. #56

    GLXTreem

    Quote Originally Posted by BojZ
    I think it's time to add a (new) "GLX section" under the PROGRAMMING section of the forum, don't you think?
    I wouldn't mind, but it's up to the moderators =)
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  7. #57

    GLXTreem

    Quote Originally Posted by AndreasL
    Quote Originally Posted by BojZ
    I think it's time to add a (new) "GLX section" under the PROGRAMMING section of the forum, don't you think?
    I wouldn't mind, but it's up to the moderators =)
    Yeah just start a thread in the 'Forums' forum :? and see if anyone has any objections. If not.... no problem

  8. #58

    GLXTreem

    I have finished the new page and uploaded the new version of glx. Download and have fun =)
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  9. #59

    GLXTreem

    :lol: :lol: :lol:

  10. #60

    GLXTreem

    An error happens when compiling Demo of GLXImageList, in GLXImageList.pas:


    Code:
    var glMultiTexCoord1fARB : PFNGLMULTITEXCOORD1FARBPROC = nil;
    var glMultiTexCoord2fARB : PFNGLMULTITEXCOORD2FARBPROC = nil;
    var glMultiTexCoord3fARB : PFNGLMULTITEXCOORD3FARBPROC = nil;
    var glMultiTexCoord4fARB : PFNGLMULTITEXCOORD4FARBPROC = nil;
    var glActiveTextureARB : PFNGLACTIVETEXTUREARBPROC = nil;
    var glClientActiveTextureARB : PFNGLCLIENTACTIVETEXTUREARBPROC = nil;


    The errors:
    [Error] GLXImageList.pas(25: Undeclared identifier: 'PFNGLMULTITEXCOORD1FARBPROC'
    [Error] GLXImageList.pas(25: Cannot initialize multiple variables
    [Error] GLXImageList.pas(259): Undeclared identifier: 'PFNGLMULTITEXCOORD2FARBPROC'
    [Error] GLXImageList.pas(259): Cannot initialize multiple variables
    [Error] GLXImageList.pas(260): Undeclared identifier: 'PFNGLMULTITEXCOORD3FARBPROC'
    [Error] GLXImageList.pas(260): Cannot initialize multiple variables
    [Error] GLXImageList.pas(261): Undeclared identifier: 'PFNGLMULTITEXCOORD4FARBPROC'
    [Error] GLXImageList.pas(261): Cannot initialize multiple variables
    [Error] GLXImageList.pas(262): Undeclared identifier: 'PFNGLACTIVETEXTUREARBPROC'
    [Error] GLXImageList.pas(262): Cannot initialize multiple variables
    [Error] GLXImageList.pas(263): Undeclared identifier: 'PFNGLCLIENTACTIVETEXTUREARBPROC'
    [Error] GLXImageList.pas(263): Cannot initialize multiple variables
    [Fatal Error] GLXImageList.pas(1: Could not compile used unit 'GLXImageList'


    Delphi 7 Enterprise

    ??

Page 6 of 7 FirstFirst ... 4567 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •