erkro1 Posted April 6, 2013 Author Share Posted April 6, 2013 I am trying to draw the faces on a picturebox (for the multiple characters system), but for some reason it only displays it for a very short time (less than half a second) and then it disappears.Code:```Sub BltCharFaces()Dim sRect As RECT, dRect As RECT, FaceNum As Long, srcRect As D3DRECT, destRect As D3DRECTDim i As Byte' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerIf NumFaces = 0 Then Exit SubDirect3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(0, 0, 0, 0), 1#, 0Direct3D_Device.BeginSceneFor i = 1 To MAX_PLAYER_CHARACTERSFaceNum = CharData(i).SpriteIf FaceNum > 0 Or FaceNum <= NumFaces ThensRect.Top = 0sRect.Bottom = sRect.Top + 100sRect.Left = 0sRect.Right = sRect.Left + 100dRect.Top = CharTopdRect.Bottom = CharTop + 100dRect.Left = CharOffSetX + (CharOffSetX * (i - 1)) + 100 * (i - 1)dRect.Right = dRect.Left + 100RenderTextureByRects Tex_Face(FaceNum), sRect, dRectEnd IfNextWith srcRect.x1 = 0.x2 = frmMenu.picFaces.Width.y1 = 0.y2 = frmMenu.picFaces.HeightEnd WithWith destRect.x1 = 0.x2 = frmMenu.picFaces.Width.y1 = 0.y2 = frmMenu.picFaces.HeightEnd WithDirect3D_Device.EndSceneDirect3D_Device.Present srcRect, destRect, frmMenu.picFaces.hwnd, ByVal (0)' Error handlerExit Suberrorhandler:HandleError "BltCharFace", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub``` Link to comment Share on other sites More sharing options...
PD Posted April 6, 2013 Share Posted April 6, 2013 Have you included a call to the subroutine in the render loop? Link to comment Share on other sites More sharing options...
erkro1 Posted April 6, 2013 Author Share Posted April 6, 2013 Nope, but thats because this is in frmMenu, and then the ServerLoop isn't activated yet.EDIT: I'll try adding the rendering in a timer tomorrow. ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now