Jump to content
Xtreme .Net Talk

rifter1818

Avatar/Signature
  • Posts

    257
  • Joined

  • Last visited

Everything posted by rifter1818

  1. Theres no Form1_load event actually, its a module dispite the name, i loaded it as a form but deleted the code and created a module latter,....
  2. Imports WindowsApplication3.Dx9 Public Module ModMain Public D3d As New Direct3d Public frmMain As New Form Public WithEvents Tmr As Timer Public Sub Main() Dim Video As New Video("C:\1.asf") Dim Audio As New Audio("C:\song_1.mid", True) Tmr = New Timer Tmr.Interval = 6000 AddHandler Tmr.Tick, AddressOf EXITGAME frmMain.WindowState = FormWindowState.Maximized frmMain.Show() 'error Dim pp As New Microsoft.DirectX.Direct3D.PresentParameters pp.Windowed = False pp.BackBufferCount = 1 pp.BackBufferFormat = Microsoft.DirectX.Direct3D.Format.X8R8G8B8 pp.BackBufferHeight = 768 pp.BackBufferWidth = 1024 pp.SwapEffect = Microsoft.DirectX.Direct3D.SwapEffect.Copy If Not D3d.Initialize(frmMain, pp, 0, Microsoft.DirectX.Direct3D.DeviceType.Hardware, Microsoft.DirectX.Direct3D.CreateFlags.SoftwareVertexProcessing) Then Debug.WriteLine("Failed Once") End If Audio.Play() AddHandler Video.Ending, AddressOf EXITGAME D3d.PlayVideo(Video) Tmr.Enabled = True End Sub Public Sub EXITGAME(ByVal sender As Object, ByVal e As EventArgs) End End Sub End Module its now saying that the form doesnt have an instance and frmmain.show
  3. Finnally found it frmmain = new form creates the object not set to an instance error.... BUT THATS WHERE IM SETTING THE INSTANCE.. Ugg,.. any ideas folks?
  4. Object refrence not set to an instance..... So i click break (using vb.net) next popup says there is no source code available for the current location!?
  5. I finnally got video rendering to texture FINNALLY but it only works in windowed mode, as soon as i go to full screen it only renders the first frame and then stops ?! Please help Public Sub PlayVideo(ByVal video As Dx9.Video) Try AddHandler video.TextureReadyToRender, AddressOf RenderVideo VBVid = New VertexBuffer(GetType(CustomVertex.TransformedTextured), 4, Me.device, 0, CustomVertex.TransformedTextured.Format, Pool.Default) Dim Verts As CustomVertex.TransformedTextured() = DirectCast(VBVid.Lock(0, 0), CustomVertex.TransformedTextured()) With Verts(0) .X = 0 .Y = 0 .Z = 0 .Rhw = 1 .Tu = 0 .Tv = 0 End With With Verts(1) .X = device.DisplayMode.Width .Y = 0 .Z = 0 .Rhw = 1 .Tu = 1 .Tv = 0 End With With Verts(2) .X = 0 .Y = device.DisplayMode.Height .Z = 0 .Rhw = 1 .Tu = 0 .Tv = 1 End With With Verts(3) .X = device.DisplayMode.Width .Y = device.DisplayMode.Height .Z = 0 .Rhw = 1 .Tu = 1 .Tv = 1 End With VBVid.Unlock() video.RenderToTexture(device) Catch ex As Exception Debug.WriteLine(ex.ToString) LastException = ex End Try End Sub Private Sub RenderVideo(ByVal sender As Object, ByVal e As TextureRenderEventArgs) Clear(System.Drawing.Color.Black) BeginScene() device.SetStreamSource(0, VBVid, 0) device.VertexFormat = VBVid.Description.VertexFormat device.SetTexture(0, e.Texture) device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2) EndScene() Present() End Sub All this is inside my D3D class which has a working initialised device, Note that it worked in Windowed mode, the DX9.video currently is just an audiovideoplayback.video (or whatever the basic dx video is) there is outside of the class another addhandler for video.ending that starts the gameloop (as this is the intro movie that im trying to get to work.
  6. I would have to agree with you Getting good royalty free music is really hard my solution was to turn to one of my childhood friends who composes music as a hobby and he's doing it for me, maybe download a systhesiser program and make your own i guess might be the best bet.
  7. Finnally Got It Public MainDevice as Direct3d.device Dim Video as new Video(filename) 'Create a vertex Buffer descriping the area you want to draw on 'i used Transformed Textured Vertex Format and full screen.... 'I can only get it to draw full screen as im not sure how to do 'dirty rectangles properly if anyone would like to show me that ' would be greatly appreciated Dim VB as vertexbuffer 'then create your area to draw on.... public Sub Play_Video() addhandler Video.texturereadytorender,addressof Render video.rendertotexture(maindevice) end sub public Sub Render(sender as object,e as texturereadyeventargs) 'not sure the actual name off the top of my head but im sure you can figure it out easy enough MainDevice.VertexFormat = VB.vertexformat MainDevice.setstreamsource 0,vb,0 maindevice.settexture 0,e.texture maindevice.clear(target,color.black,0,0) maindevice.beginscrene maindevice.drawprimitives(trianglestrip,0,2) maindevice.endscene maindevice.present end sub In other Words simply re render the area you want to draw on when the textureready event happens,.. My thoughts have been either play the video full screen and stop everything else until its done or create an if statement in the texture ready event or something so that the function wont disrupt the rest of what your trying to render if it occers during another loop rendering,.. Im not even sure that is possible but its about midnight and time for me to go to sleep just thought id share this finnally working code with you.
  8. As some of you may know im creating a directx dll for my RPG and i have come to the lighting section, Just wondering if you kind folks knew of some good tutorials or tricks for directx 9.0 (managed) lighting, my current launguage is VB.net so that would be preffered of course C# is fine as there are many translation sites around :)... PS so far i have Initialising, Clear,Begin Screen, End Screen, Present, Functions for checking display settings, Drawing and manipulating vertex buffers, Meshes and annimated meshs done, allong with input so its actually getting there finally, with much help from all of you here :).
  9. Thanks for your help What i was looking for i guess was how to add items to an array list. I guess that about raps it up for my D3D Class just lighting to go so if anyof you are so kind im sure ill be adding yet more posts to the directx section, hopefully a few of them will be answered.. Thanks for all your help folks
  10. Thanks for your help How would i fill the array list with the object instances? would it be dim i as integer redim MeshList(whatever) for i = 0 to whatever MeshList(i) = new customvertex.something(elements) next
  11. rifter1818

    sounds

    Driving you nuts too? Sorry but unfortunatly the only way i can think off is to distroy all speakers (including the internal one), which probably isnt a good idea.
  12. Ive Been saving the projects and copy pasting out of them too But would it not be better if you find your creating alot of good reusable functions to create a dll of them (thats what ive started to do with my dx9 classes, and my custom mesh's and animated mesh classes)
  13. Is there any way (im using VB.net) for me to create an array of (i guess objects initially) and then latter deffine them,.. The use ive run into so far is creating an animated Mesh class i want to keep an array for each keyframe of verticies (i know it costs memory, but itll increase framerate) but the thing is i dont want to limit my class to just one type of mesh so i need to in the initialize function or new sub depending on how im fealing when you all come up for an answer here define this array as a specific vertexformat.... say as me.vertexbuffer.description.vertexformat or some such thing. Thanks in advance for your help.
  14. Thanks for the post I never actually knew that you could write macros for the enviornment im sure ill have fun with them,.. however ive often thought that this was something that was missing, im programming a rpg and scanning through 40 or 50 objects is annoying every time.....
  15. Did you forget to create a new instance? psi = new process() at least i think your using processes and i dont know if there are any arguments needed for the new call,.. but thats the usual fix for that error in my experiance
  16. The only thing is That way means i have to program compairto's into every structure, and if i want to sort by x's first then latter sort by y's or sort by x's and then sort by y's the code gets more and more complicated, if i could find a way to send a function which element it is it would be much easyer,.. and would be usefull in other instances which are a bit more complicated
  17. Im creating a general sorting algorythm, pretty simple but i want it to be able to sort any array,.... so lets say i have an array of blahs public structure blah public x,y as integer end structure and i want this array sorted by the x's... public sub sort(array() as object,subobject as ??????) if array(i).subobject < array(i+1).subobject then ....... end if .... end sub sorry for the shortened code but the concept is so simple. i just need to know how to pass elemnts to the functions / subs.. Thanks for all your help
  18. What tool can you get to do that in VB? or is there a way to do it through code (there should be, but things that should be arnt allways in microsoft programs)
  19. Ok All ive been able to play is the first frame,.. And i have no idea what the flashing colors where but im pretty sure it wasnt my movie playing too fast.
  20. Im Trying Im trying,.. In VB the closest ive come is to get the first (or last not sure) frame to render, now i think i might be playing the video at warp speed but im not sure, i just see some colors flashing for less than a second,... Ugg not working at all.....
  21. Thank you Very Much :D
  22. I had the same problem, theres a post here labled annimation with what you need Thanks to allot of help from many people here.
  23. K that function works, Except It returns a .z value, and is a bit off if i just use x and y, i need the just x and y coordinants.....
  24. I need help getting the Screen Position of an object in a 3d space. Anyone know how this could be done?
  25. I need a way to export or convert my Maya files to either .x or .3ds files, any advice?
×
×
  • Create New...