1. Post #1441
    Gold Member
    Darwin226's Avatar
    January 2009
    4,031 Posts
    Great now I just have to remember this!
    Just force yourself to use it once, after that you start to realize how many times it does exactly what you need.
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Agree Agree x 1 (list)

  2. Post #1442
    ichiman94's Avatar
    August 2010
    854 Posts
    Oh yes, map loading from txt files
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <newmap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsize>20</xsize>
      <ysize>20</ysize>
      <layers>
        <layer>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,1,0,1,0,1,0,0,1,1,1,0,1,1,0,0,0,0
    0,0,0,2,0,2,0,0,0,0,2,0,0,0,2,0,1,0,0,0
    0,0,0,2,1,2,0,2,0,0,2,2,0,0,2,2,0,0,0,0
    0,0,0,2,0,2,0,2,0,0,2,0,0,0,2,0,0,0,0,0
    0,0,0,2,0,2,0,2,0,0,2,0,0,0,2,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
    2,1,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,1,2
    2,2,2,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,2,2
    3,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3
    3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3
    3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3
    3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
    3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
    3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3</layer>
      </layers>
      <entities>
        <entity>
          <type>info_player_start</type>
          <name>Watson</name>
          <target></target>
          <x>224</x>
          <y>352</y>
          <layer>0</layer>
          <attribs>
            <attrib>
              <name>weapon</name>
              <value>fists</value>
            </attrib>
          </attribs>
        </entity>
      </entities>
    </newmap>
    Much better. Making your own txt map parsers just reinvents the wheel, I think your environment (c# or java) has a nice Xml Serializer that translates those stuff to objects, and then you don't have to implement all that thing by hand.
    Reply With Quote Edit / Delete Windows 7 Hungary Show Events Dumb Dumb x 2 (list)

  3. Post #1443
    Gold Member
    ryandaniels's Avatar
    December 2006
    3,940 Posts
    Hi everyone.
    I started working on a little game in XNA for practise.
    (At first i tried to make a snake copy but then i had better ideas :D)

    It loads the map from an image file:
    No offense, but why did you have to record (almost) your entire screen for this demonstration?

    Also, why does everyone seem to think we all want to know about their taste in indie anarcho-punko-caribbean german electro-pop dubstep revival nuevo jazz post harlem white supremecist underground streetracing music.


    The thing that's ridiculous about it is everyone of the people making videos thinks they're being really sly and everyone watching doesn't realize they specifically turned on their favorite song and scrolled down to their best patch of code. Obviously they were just being ultra laid back and just recorded a video of their software on a whim and couldn't be bothered to crop it and turn off the music playing in the background.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 10Funny Funny x 3Friendly Friendly x 1Optimistic Optimistic x 1 (list)

  4. Post #1444
    Gold Member
    Lord Fear's Avatar
    April 2006
    1,050 Posts
    DirectX 10/11 window running in perfect harmony from C#.
    All DirectX stuff is done in C++ and compiled to a DLL. C# then loads the DLL and interacts with the window from a managed class. I admit, I haven't done much of the C++ stuff but I know how it all works at least. I did do the C# part though.



    It's a group project for 3D programming. We got a list of example stuff (if we do something awesome not on the list then we'd get credit for that) that would give us points if we did and then we had to get like 10 points each or something to pass. So we decided to make a level editor because it's fairly simple and something we could throw in as much shit as possible on. The reason we decided to blend in C# is because of it's wonderful Windows Forms. All GUI will be done through C# and the DX window will work as a preview window.

    Oh and so far, nothing fancy is done. All that the C# can do is start the DirectX window. Currently working on adding tools for spawning objects (loaded from .obj files).
    Later, I'm going to add a heightmap editor to draw terrain which will update in realtime on the preview window.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Winner Winner x 7 (list)

  5. Post #1445
    Tortex's Avatar
    July 2010
    51 Posts
    Working on ma GUI
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Artistic Artistic x 3 (list)

  6. Post #1446
    Follow me on github!
    benjojo's Avatar
    January 2009
    2,611 Posts
    Steam Bot:
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Winner Winner x 13Funny Funny x 2 (list)

  7. Post #1447
    I gave enough money to buy a soda.
    Funley's Avatar
    May 2010
    1,389 Posts
    xml stuff

    Much better. Making your own txt map parsers just reinvents the wheel, I think your environment (c# or java) has a nice Xml Serializer that translates those stuff to objects, and then you don't have to implement all that thing by hand.
    Maybe soon.

    Also, i got a main menu and three different maps working.



    The menu really speaks for the game's name
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Winner Winner x 2 (list)

  8. Post #1448
    Gold Member
    Lexic's Avatar
    March 2009
    6,118 Posts

    Well it's a start <:
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 2Informative Informative x 1Winner Winner x 1 (list)

  9. Post #1449
    Gold Member
    Loli's Avatar
    April 2008
    2,288 Posts
    Gonna take on the mammoth task that is... DIRECTX

    ...

    Fuck...
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  10. Post #1450
    Gold Member
    Darwin226's Avatar
    January 2009
    4,031 Posts
    Gonna take on the mammoth task that is... DIRECTX

    ...

    Fuck...
    Why?
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Dumb Dumb x 1 (list)

  11. Post #1451
    Tortex's Avatar
    July 2010
    51 Posts
    Added an attack 'effect'.

    Slicin' them skeletons
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  12. Post #1452
    Gold Member
    Loli's Avatar
    April 2008
    2,288 Posts
    It's notorious for being a pain in the arse, and I'm going to try and learn it.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Disagree Disagree x 1 (list)

  13. Post #1453
    Philly c's Avatar
    February 2008
    551 Posts
    It's notorious for being a pain in the arse, and I'm going to try and learn it.
    You may be mistaking it for opengl.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Disagree Disagree x 3Funny Funny x 2Dumb Dumb x 1 (list)

  14. Post #1454
    Gold Member
    Lexic's Avatar
    March 2009
    6,118 Posts

    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Winner Winner x 22Programming King Programming King x 4 (list)

  15. Post #1455
    Gold Member
    Darwin226's Avatar
    January 2009
    4,031 Posts
    It's notorious for being a pain in the arse, and I'm going to try and learn it.
    Sorry for not explaining. I meant, why learn DX instead of OpenGL for example?
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Agree Agree x 3Disagree Disagree x 1Dumb Dumb x 1 (list)

  16. Post #1456
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts


    HEH
    Reply With Quote Edit / Delete Windows 7 United States Show Events Winner Winner x 7 (list)

  17. Post #1457
    Gold Member
    Loli's Avatar
    April 2008
    2,288 Posts
    Sorry for not explaining. I meant, why learn DX instead of OpenGL for example?
    Not sure, Didn't like OpenGL.
    Which would you guys recommend learning (Since Open.GL is down)
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  18. Post #1458
    Gold Member
    Lexic's Avatar
    March 2009
    6,118 Posts
    OpenGL all the way.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 4Disagree Disagree x 3 (list)

  19. Post #1459
    PENISCORP DIRECTOR
    Gran PC's Avatar
    August 2007
    3,082 Posts
    So I was testing debug hooks in Lua, just because I needed to make sure the hook wouldn't get called when its own code was executing, and...
    Reply With Quote Edit / Delete Windows 7 Spain Show Events Optimistic Optimistic x 5Winner Winner x 2Programming King Programming King x 1 (list)

  20. Post #1460
    Gold Member
    Darwin226's Avatar
    January 2009
    4,031 Posts
    Not sure, Didn't like OpenGL.
    Which would you guys recommend learning (Since Open.GL is down)
    You're not going to get cross platform support any time soon with DirectX. But if that doesn't bother you, by all means try DirectX.
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events

  21. Post #1461
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    You may be mistaking it for opengl.
    Nope, DirectX is as much of a pain in the ass as modern OpenGL, despite what people think.

    In fact it takes more lines of code to initialize DirectX 10 than OpenGL 3.3 without any libraries.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Disagree Disagree x 1Agree Agree x 1 (list)

  22. Post #1462
    Gold Member
    danharibo's Avatar
    July 2006
    4,432 Posts
    You may be mistaking it for opengl.
    OpenGL is far from a pain in the ass.
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Agree Agree x 5Disagree Disagree x 4Zing Zing x 1 (list)

  23. Post #1463
    Eudoxia's Avatar
    July 2009
    6,009 Posts
    I'm liking the OpenGL SuperBible.

    Before I knew anything about OpenGL and DirectX, I sort of liked OpenGL by default because of the whole "open" thing. Now I like it more, because platform independence is important to me. Sure, maybe your game targets X-Boxes, but wouldn't it be cooler if you cold port it to anywhere with minimal changes, or just a couple clever preprocessor #if's?
    Reply With Quote Edit / Delete Linux Uruguay Show Events

  24. Post #1464
    Gold Member
    Loli's Avatar
    April 2008
    2,288 Posts
    Could anybody recommend some Libs for OpenGL then? I hear GLUT is outdated.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  25. Post #1465
    Eudoxia's Avatar
    July 2009
    6,009 Posts
    Could anybody recommend some Libs for OpenGL then? I hear GLUT is outdated.
    GLFW I suppose.
    Reply With Quote Edit / Delete Linux Uruguay Show Events Agree Agree x 5Informative Informative x 1 (list)

  26. Post #1466
    Gold Member

    March 2005
    3,028 Posts
    OpenGL is far from a pain in the ass.
    The whole state machine thing is a tad archaic.


    On a related note, does anyone know what the typical/proper semantics are for uniform block bindings? I've been setting them each and every time I change programs, but I think this might be excessive. They're part of the global state, right? Not program state like regular Uniforms?
    Reply With Quote Edit / Delete Windows 7 Show Events

  27. Post #1467
    ToNi's Avatar
    March 2010
    102 Posts
    No offense, but why did you have to record (almost) your entire screen for this demonstration?

    Also, why does everyone seem to think we all want to know about their taste in indie anarcho-punko-caribbean german electro-pop dubstep revival nuevo jazz post harlem white supremecist underground streetracing music.


    The thing that's ridiculous about it is everyone of the people making videos thinks they're being really sly and everyone watching doesn't realize they specifically turned on their favorite song and scrolled down to their best patch of code. Obviously they were just being ultra laid back and just recorded a video of their software on a whim and couldn't be bothered to crop it and turn off the music playing in the background.
    First of all why is it a problem to record a bigger area of my screen? (Anyway the reason for that size is that i recorded something else previously and i was lazy to change it)
    Secondly i forgot to turn off the audio recording, sorry for that.
    Thirdly that kind of music is not my style but if i listen to a music that i realy like i cannot concetrate to the code. (But i think it's still better for the majority if the video has this kind of music than for instance Metallica or Slayer what really i like.)
    Reply With Quote Edit / Delete Windows 7 Hungary Show Events

  28. Post #1468
    Philly c's Avatar
    February 2008
    551 Posts
    Nope, DirectX is as much of a pain in the ass as modern OpenGL, despite what people think.

    In fact it takes more lines of code to initialize DirectX 10 than OpenGL 3.3 without any libraries.
    I don't really think lines of code is a big deal in this case. Besides, opengl has that inspecific pixel format thing, and for windows it is more complex. Sure you need to get a swapchain and back buffer for direct3d10, but it's all explicit with no bullshit and allows you to use the backbuffer like a regular render target which opengl can't do. Actually opengls whole framebuffer situation is absolutely fucked in my opinion.

    Basically my point is that learning opengl is frustrating. There's a lot of very annoying things that work strangely coupled with bad documentation. I'm not talking about simply drawing a couple of triangles here. Actually I had to quit with opengl for now after my driver crashed when trying to create an srgb renderbuffer.

    Sorry I didn't really mean to get in to a rant about it especially because I was only joking around with my first post but whatever.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Dumb Dumb x 1 (list)

  29. Post #1469
    Gold Member

    March 2005
    3,028 Posts
    I don't really think lines of code is a big deal in this case. Besides, opengl has that inspecific pixel format thing, and for windows it is more complex. Sure you need to get a swapchain and back buffer for direct3d10, but it's all explicit with no bullshit and allows you to use the backbuffer like a regular render target which opengl can't do. Actually opengls whole framebuffer situation is absolutely fucked in my opinion.
    You're doing it wrong. In modern OpenGL, you should be using FBOs for offscreen rendering. You only draw to the backbuffer when you actually want something to be displayed on screen.
    Reply With Quote Edit / Delete Windows 7 Show Events

  30. Post #1470
    Philly c's Avatar
    February 2008
    551 Posts
    You're doing it wrong. In modern OpenGL, you should be using FBOs for offscreen rendering. You only draw to the backbuffer when you actually want something to be displayed on screen.
    My point is that to render to the backbuffer you have to turn your framebuffer off whereas in direct3d10 it is treated as regular render target and even a texture for shaders. What you make of that is up to you I guess.

    Not only that but in opengl I found it was not possible to have a pixel format without a depth buffer, nor a 32 bit float if that's what you need, leaving it useless as it's not possible to be used in a framebuffer object.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  31. Post #1471
    PENISCORP DIRECTOR
    Gran PC's Avatar
    August 2007
    3,082 Posts
    Reply With Quote Edit / Delete Windows 7 Spain Show Events Programming King Programming King x 1 (list)

  32. Post #1472
    sim642's Avatar
    July 2010
    1,039 Posts
    Ughh, non-monospaced font for code.
    Reply With Quote Edit / Delete Windows Vista Estonia Show Events Agree Agree x 21Optimistic Optimistic x 1 (list)

  33. Post #1473
    Tortex's Avatar
    July 2010
    51 Posts
    Working on a spell/skill system!
    got the basics down, kinda ugly implementation tough, need to think of a prettier way to do it, but it does the job.

    Trap removal


    By fire be purged!
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Artistic Artistic x 1 (list)

  34. Post #1474
    PENISCORP DIRECTOR
    Gran PC's Avatar
    August 2007
    3,082 Posts
    Ughh, non-monospaced font for code.
    It's customizable. I like it like this.
    Reply With Quote Edit / Delete Windows 7 Spain Show Events

  35. Post #1475
    Gold Member

    March 2005
    3,028 Posts
    My point is that to render to the backbuffer you have to turn your framebuffer off whereas in direct3d10 it is treated as regular render target and even a texture for shaders. What you make of that is up to you I guess.
    Eh?
    To switch back to the regular framebuffer, you use glBindFramebuffer(GL_FRAMEBUFFER, 0);.
    You could choose to think about it as the FBO with the ID of '0'.

    And like I said, you shouldn't be accessing the front- or back-buffers, anyway, so the 'texture' issue doesn't matter.

    Not only that but in opengl I found it was not possible to have a pixel format without a depth buffer, nor a 32 bit float if that's what you need, leaving it useless as it's not possible to be used in a framebuffer object.
    You're wrong about both. The completeness rules for FBOs do not require a depth buffer to be attached, and you have 1-, 2-, 3- and 4-channel 32-bit floating-point formats to choose from (GL_R32F, GL_RG32F, GL_RGB32F, and GL_RGBA32F).
    Reply With Quote Edit / Delete Windows 7 Show Events

  36. Post #1476
    zachcalhoun's Avatar
    June 2009
    26 Posts
    So I'm still working on that tetris code. Collisions are pretty much done, and I started working on line detection code, and I disabled for debugging purpuses a function that I made reduntant anyway. What the function did was take a snapshot of the blocks and store them for redrawing, that was how I held block data before using arrays. I didn't dump it yet because I needed to store colors somewhere. Anyway when I started to look at the actual array, i found out that that function was masking a very bad bug, which was removing blocks from the array at the left of any falling block, an i have no ideea why.
    Reply With Quote Edit / Delete Windows 7 Romania Show Events

  37. Post #1477
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    Me and my mate have been working on a tank game recently, progress is slow but its getting there!


    As you can see, I'm having some minor problems with the UVs...

    Also this is my first post in here so be gentle
    I just skimmed through the posts since this, but try flipping either the U or the V on your UV's. Do vertexUV.x = 1.0f - sourceUV.x;
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  38. Post #1478
    Gold Member
    Jookia's Avatar
    July 2007
    6,768 Posts
    stop arguing about which is better because it's clearly opengl as it runs on anything
    Reply With Quote Edit / Delete Linux Australia Show Events Agree Agree x 6Funny Funny x 3Dumb Dumb x 1Optimistic Optimistic x 1 (list)

  39. Post #1479
    This title has been removed due to a copyright claim from Viacom Inc.
    neos300's Avatar
    July 2008
    3,478 Posts
    Regional science fair next weekend, and apparently it's common for google and Intel to hand out scholarships and merchandise to contestants, hoping I score something.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1Agree Agree x 1 (list)

  40. Post #1480
    Philly c's Avatar
    February 2008
    551 Posts
    Eh?
    To switch back to the regular framebuffer, you use glBindFramebuffer(GL_FRAMEBUFFER, 0);.
    You could choose to think about it as the FBO with the ID of '0'. Then GL_BACK and whatnot would be the different attachments.
    I guess i'm just not explaining good enough. Honestly at this point I don't know if i'm right or wrong any more. What I thought is that it's not possible to add the context back buffer and depth/stencil combo to an FBO along with other renderbuffers you created yourself.


    You're wrong about both. The completeness rules for FBOs do not require a depth buffer to be attached, and you 1-, 2-, 3- and 4-channel 32-bit floating-point formats to choose from (GL_R32F, GL_RG32F, GL_RGB32F, and GL_RGBA32F).
    I know this but i'm talking about pixel formats. When you create the context it comes with a depth buffer whether you ask for it or not because I checked and my card does not have a single relevant pixel format without a 24 bit depth buffer. And also if i'm correct about what I said above, this depth buffer is generally useless because you can't use it in your own FBO.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events