Logo

¡Bienvenido a Stratos!

Acceder

Foros



Menu

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menu

Mensajes - •Parra

#61
General Programadores / VB6 & MySQL
04 de Julio de 2009, 10:07:29 PM
Hola amigos! ^^

Tenia una duda.. y es la siguiente:

Tengo instalado el AppServer 2.4.7, y he creado una base de datos, que puedo conectarme en localhost, editarla y hacer todo lo que quiera... y ahora quise probar conectandome con el mismo codigo a una base de datos, en un host web (concretamente, byethost), y me dice que no existe la base de datos, pero si me puedo conectar desde php.

Esto porque pasa? Es porque solo puedo conectarme creando una base de datos en mi pc? VB6 se puede conectar a una base de datos en un hosting web? Es lo mismo o son cosas diferentes?

Gracias a las respuestas.. :P
#62
Programación gráfica / Re: Vertex Buffers?
30 de Junio de 2009, 03:33:28 AM
van subiendo algo los fps.. y no termina de verse igual =/ se ven menos particulas si le bajo eso..

estaria bueno lo de vertex buffers.. si tienes un poco de idea.. de donde encontrar un tutorial o algo asi, te agradeceria..

Yo el procedimiento de renderizado lo tengo asi ahora:

Código (vb) [Seleccionar]
Private Sub particleGroupRender(ByRef particleGroup As structParticleGroup)

    With D3DDevice
   
        .SetRenderState D3DRS_POINTSPRITE_ENABLE, 1 'True
        .SetRenderState D3DRS_POINTSCALE_ENABLE, 0 'True
        .SetRenderState D3DRS_POINTSIZE, particleGroup.lngFloatSize
        .SetRenderState D3DRS_POINTSIZE_MIN, particleGroup.lngFloat(0)
        .SetRenderState D3DRS_POINTSCALE_A, particleGroup.lngFloat(0)
        .SetRenderState D3DRS_POINTSCALE_B, particleGroup.lngFloat(0)
        .SetRenderState D3DRS_POINTSCALE_C, particleGroup.lngFloat(1)
        .SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
        .SetRenderState D3DRS_DESTBLEND, D3DBLEND_ONE
        .SetRenderState D3DRS_ALPHABLENDENABLE, 1
         
        .SetVertexShader (D3DFVF_XYZRHW Or D3DFVF_DIFFUSE Or D3DFVF_TEX1)
                 
        .SetTexture 0, particleGroup.pTexture
         
         
         Dim i As Long
         
         For i = 1 To particleGroup.pCount
         
            .DrawPrimitiveUP D3DPT_POINTLIST, particleGroup.pCount / 2, particleGroup.particleInfo(i).vertexPoints(0), Len(particleGroup.particleInfo(i).vertexPoints(0))
       
        Next i
    End With

End Sub


Edit: ya está listo!! ^^

Rehize el sistema.. y ahora me va perfecto :P listo, pueden cerrar! Gracias por todooo!
#63
Programación gráfica / Re: Vertex Buffers?
30 de Junio de 2009, 12:36:02 AM
Claro pero yo lo tengo asi.. lo unico que cambia es que tengo un Quad por cada particula..

como podria cambiar eso?

No se como me quieres decir tu =/
#64
Programación gráfica / Re: Vertex Buffers?
29 de Junio de 2009, 10:50:33 PM
Como envio el array completo? tienes un ejemplo? =/

yo lo tengo asi: (pero está fatal..)

Código (vb) [Seleccionar]
         Dim i As Long
         
         For i = 1 To particleGroup.pCount
         
            .DrawPrimitiveUP D3DPT_POINTLIST, particleGroup.pCount , particleGroup.particleInfo(i).vertexPoints(0), Len(particleGroup.particleInfo(i).vertexPoints(0))
       
        Next i
#65
Programación gráfica / Vertex Buffers?
29 de Junio de 2009, 09:21:48 PM
Hola de nuevo ^^

Bueno.. como ya dije que haria, vine para postear alguna imagen segun iba avanzando el proyecto :P




Y bueno, tenia una duda que se me planteó al hacer el sistema de particulas.. y es que me realentiza mucho.. =/ Sin particulas llegaba a 3000 fps.. y ahora con particulas solo a 180, pero es porque tengo que hacer un drawprimitiveup por cada particula..

Me preguntaba si habia alguna manera más rapida de renderizar.. si con vertex buffers, o algo parecido.. que me han comentado (muy poco..) si podia hacer esto más rapido..

Si tienen alguna idea de como podria hacerlo me gustaria escucharla ^^ (Y si me sirbe.. ver si se puede usar tambien en el renderizado normal de texturas..)
#66
ok, cuando vaya haciendo el mapeado.. postearé alguna imagen ;)
#67
listo!! ya lo arreglé.. era todo culpa del spaweffect :P

muchas gracias por interesarse.. y por los consejos.. saludos! (pueden cerrar..)
#68
eso lo hice pensando en actualizar independientemente cuando necesitara actualizar las interfaces.. pero es todo un lio increible.. solo solucionando lo de RECT en .persent me bastaria!

tu tienes lo de los rects implementados en tu libreria? si es asi.. me sabrias decir porque tengo ese error? =/
#69
si! exactamente.. eso es.. DirtyRects.

Es lo que quiero hacer =/ pero no puedo.. gracias por toda la informacion sobre tu mp3..

entonces.. no tengo solución para hacer present en un rect? :(

edit: ah si.. acabo de ver el tutorial.. yo ya hice un programa tipo este.. fué facil.. el problema que me encontré fue.. que necesito reproducir distintos mp3 a la vez.. y no pude hacerlo.. =/

el otro problema.. aunque es una tonteria.. es el molesto iconzito.. que te sale cada vez que reproduces algo..

edit2: el unico remedio que veo contra eso.. si no puedo arreglar.. seria hacer un modulo como este:

Código (vb) [Seleccionar]
Option Explicit

'Module to management textures(GUI)

Private Type structGUI
    Tex     As Direct3DTexture8
    Path    As String
    Width   As Integer
    Height  As Integer
   
    vert(3) As TLVERTEX
End Type
   
Private Texture() As structGUI

Public Function GuiInitialize() As Boolean
On Error GoTo ErrHandle
    Dim i As Long

    ReDim Preserve Texture(1 To 1) As structGUI
   
    'Provisional
    Texture(1).Path = "\Graphics\frmmain.jpg"
    Texture(1).Width = 800
    Texture(1).Height = 600
   
    For i = 1 To UBound(Texture)
        If GuiLoadTexture(i) = False Then GoTo ErrHandle
        GuiSetGeometry (i)
    Next i

    GuiInitialize = True
    Exit Function
   
ErrHandle:
    GuiInitialize = False
    Exit Function
End Function

Private Function GuiLoadTexture(ByRef Index As Long) As Boolean
On Error GoTo ErrHandle

    With Texture(Index)
        Set .Tex = D3DX.CreateTextureFromFileEx(D3DDevice, _
                            App.Path & .Path, .Width, .Height, _
                            D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, _
                            D3DPOOL_MANAGED, D3DX_FILTER_POINT, _
                            D3DX_FILTER_POINT, D3DColorXRGB(255, 0, 128), _
                            ByVal 0, ByVal 0)
    End With
   
    GuiLoadTexture = True
    Exit Function
   
ErrHandle:
    GuiLoadTexture = False
End Function
Private Sub GuiSetGeometry(ByRef Index As Long)
    With Texture(Index)
        .vert(0) = setVertex(0, 0, 0, 1, -1, 0, 0, 0)
        .vert(1) = setVertex(CSng(.Width), 0, 0, 1, -1, 0, 1, 0)
        .vert(2) = setVertex(0, CSng(.Height), 0, 1, -1, 0, 0, 1)
        .vert(3) = setVertex(CSng(.Width), CSng(.Height), 0, 1, -1, 0, 1, 1)
    End With
End Sub
Public Sub GuiDelete()

    Dim i As Long
   
    For i = 1 To UBound(Texture)
        Set Texture(i).Tex = Nothing
    Next i
   
End Sub
Public Sub GuiRender()

    If (testCooperative = False) Then Exit Sub

    Dim i As Long

    For i = 1 To UBound(Texture)
        If Texture(i).Tex Is Nothing Then
            If (GuiLoadTexture(i) = False) Then Exit Sub
        End If
       
        With D3DDevice
         .Clear 0, ByVal 0&, D3DCLEAR_TARGET, 0, 1#, 0
            .BeginScene
           
            .SetTexture 0, Texture(i).Tex
            .DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, Texture(i).vert(0), Len(Texture(i).vert(0))
           
            .EndScene
         .Present ByVal 0&, ByVal 0&, frmMain.hwnd, ByVal 0&
        End With
    Next i
   
End Sub


aunque no me convence demasiado.. renderizar texturas de 800x600 es mortal..
#70
Si, es verdad, me funciona perfectamente, pero el problema que tengo es que no le puedo poner que haga .present solo en una zona.. debo de hacer .present en toda la pantalla y eso es lo que no quiero hacer

alguna solución?

PD: estaba buscando tu email.. y vi que eres moderador de aqui..
he visto tu dll tambien, pero prefiero hacer mi motor.. ya que tengo varios diferentes armados.. y las bases son buenas..

la web que mencionaste ya la conocia.. la usé sobre todo cuando estube jugando con dx7..

otra cosa.. como reproduces en tu dll los mp3? usas la api de windows?
#71
Programación gráfica / Error! Visual Basic 6 (Directx 8)
02 de Junio de 2009, 09:52:19 PM
Buenas! Estaba buscando un foro como este.. donde tubieran programación grafica y me pudieran ayudar.. y me acabo de registrar!

Ya se que visual basic 6 es uno de los peores lenguajes.. u_u pero bueno, algo bueno podré hacer con él ^^

Mi problema es..
estoy haciendo un motor isometrico.. hice la carga de texturas.. todo perfecto, tambien hice que calculara los cuadrados de diferentes perspectivas isométricas.. etc.. por ahora el motor beta está todo bien.. excepto mi error..

Yo uso de esta forma las funciones para limpiar la pantalla, y hacer .present:

Código (vb) [Seleccionar]
Private Sub deviceBeginScene()
   
    With D3DDevice
       
        If (eWindowed = True) Then
            .Clear 1, DirectxRect, D3DCLEAR_TARGET, 0, 1#, 0
        Else
            .Clear 0, ByVal 0&, D3DCLEAR_TARGET, 0, 1#, 0
        End If
       
        .BeginScene
    End With
   
End Sub
Private Sub deviceEndScene()

    With D3DDevice
       
        .EndScene
   
        If (eWindowed = True) Then
            .Present RenderRect, RenderRect, frmMain.hwnd, ByVal 0
        Else
            .Present ByVal 0&, ByVal 0&, frmMain.hwnd, ByVal 0&
        End If

    End With
   
End Sub


El .clear me funciona perfectamente en full screen y windowed.. pero el .present, me da error en modo windowed.. me da error de automatización.. y no lo he podido arreglar.. he probado jugando bastante.. y nada.. siempre el mismo error..

entonces.. envez de usar esa forma que tengo arriba.. me gutaria usar el modo de full screen para los dos modos sin que me de error.. hay alguna posibilidad? porque me da este error?

Gracias a todos los interesados en ayudar ;)

edit: aclaro.. el error me lo da cuando le doy al debugger..

la iniciación del directx la tengo asi:
Código (vb) [Seleccionar]
Public Function engineInitializing(ByRef Top As Integer, ByRef Left As Integer, ByRef Width As Integer, ByRef Height As Integer, Frm As Form, Optional ByRef BitsPerPixel As Byte = 32, Optional ByRef Windowed As Boolean = True) As Boolean

On Error GoTo ErrHandle
   
    Set DX = New DirectX8
    Set D3D = DX.Direct3DCreate
    Set D3DX = New D3DX8
   
    eWindowed = Windowed
   
    With RenderRect
        .Top = Top
        .Left = Left
        .Right = Width
        .bottom = Height
    End With
   
    With DirectxRect
        .X1 = Left
        .X2 = Width
        .Y1 = Top
        .Y2 = Height
    End With
   
    '*******************************
    'Initialize video device
    '*******************************
    Dim DevType As CONST_D3DDEVTYPE
    Dim D3DCreate As CONST_D3DCREATEFLAGS
   
    DevType = D3DDEVTYPE_HAL

    D3D.GetDeviceCaps D3DADAPTER_DEFAULT, DevType, DevCaps
    D3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispMode
   
    With D3DWindow
   
        If (Windowed = False) Then
       
            .SwapEffect = D3DSWAPEFFECT_FLIP
            .FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT
            .FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE
           
            'Fullscreen mode stuff here
            Select Case BitsPerPixel
                Case 32
                    .BackBufferFormat = D3DFMT_A8R8G8B8
                Case 24
                    .BackBufferFormat = D3DFMT_R8G8B8
                Case 16
                    .BackBufferFormat = D3DFMT_R5G6B5
                Case Else
                    .BackBufferFormat = D3DFMT_A8R8G8B8
            End Select
           
            .BackBufferWidth = 800
            .BackBufferHeight = 600

            .BackBufferCount = 1
        Else
            .Windowed = 1
            .SwapEffect = D3DSWAPEFFECT_COPY
            .BackBufferFormat = DispMode.Format
        End If
       
        .hDeviceWindow = Frm.hwnd
       
    End With
   
       
    'To check the rest we use:
    If Not D3D.CheckDeviceType(D3DADAPTER_DEFAULT, DevType, DispMode.Format, DispMode.Format, 1) = D3D_OK Then
        DevType = D3DDEVTYPE_REF
    ElseIf Not D3D.CheckDeviceType(D3DADAPTER_DEFAULT, DevType, DispMode.Format, DispMode.Format, 1) = D3D_OK Then
        DevType = D3DDEVTYPE_SW
    End If
   
    'For Hardware vertex processing:
    If Not (DevCaps.DevCaps And D3DDEVCAPS_HWTRANSFORMANDLIGHT) Then
        D3DCreate = D3DCREATE_SOFTWARE_VERTEXPROCESSING
    Else
        D3DCreate = D3DCREATE_HARDWARE_VERTEXPROCESSING
    End If
   
    'Set the D3DDevices
    If Not D3DDevice Is Nothing Then Set D3DDevice = Nothing
    Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, DevType, Frm.hwnd, D3DCreate, D3DWindow)
   
    'Reset the device's rendering state
    deviceResetRenderStates

    fontInitializing (GetVar(App.Path & "\Init\Fonts.ini", "Info", "Size"))
   
    'Clear the back buffer
    D3DDevice.Clear 0, ByVal 0&, D3DCLEAR_TARGET, 0, 0, 0
   
    'Initialize DB
    If (texInitialize() = False) Then GoTo ErrHandle
   
    'Initialize Index
    loadGrh
   
    engineInitializing = True
    Exit Function
   
ErrHandle:
    MsgBox "Error al iniciar el motor grafico"
    engineInitializing = False
End Function






Stratos es un servicio gratuito, cuyos costes se cubren en parte con la publicidad.
Por favor, desactiva el bloqueador de anuncios en esta web para ayudar a que siga adelante.
Muchísimas gracias.
Stratos es un servicio gratuito, cuyos costes se cubren en parte con la publicidad.
Por favor, desactiva el bloqueador de anuncios en esta web para ayudar a que siga adelante.
Muchísimas gracias.