1. Post #2161
    Gold Member
    PortalGod's Avatar
    August 2009
    2,381 Posts
    I'm trying to interact with javascript on a website through a windows form, and it occured to me that VB.NET (shut up) might not be the best option to use. What other things could I use for javascript interactions?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  2. Post #2162
    Slaaf van EternalFlamez.Ik wilde heel graag de laatste Indie Bundle, en ik kreeg deze kuttitel er gratis bij.
    Staneh's Avatar
    March 2010
    4,073 Posts

    Abit of an update on my video, made the torch work correctly, I added collision (Not in the video, needs fixing.)
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  3. Post #2163
    Map in a box's Avatar
    July 2009
    7,419 Posts
    My GUI system has hit a hault. Slick2D doesn't have support for "stacked" clips. Can you do this in OpenGL?
    Reply With Quote Edit / Delete Windows XP United States Show Events

  4. Post #2164
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts

    Right, that's the graphics and input sorted.
    Now I just need to port my terrible 2d collision system from C++ to Lua, find out why the hell it doesn't work, sort it out, then port it back to C++. Woo.
    Incidentally, does anyone know what screenshot prog turb uses?
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Optimistic Optimistic x 1 (list)

  5. Post #2165
    Gold Member

    March 2005
    3,028 Posts
    My GUI system has hit a hault. Slick2D doesn't have support for "stacked" clips. Can you do this in OpenGL?
    Stencil testing?

    If you just want to calculate the intersection of a bunch of axis-aligned rectangles in 2D space, you can take the minimum of their maximum x- and y- coordinates and the maximum of their minimum x- and y- coordinates. This would enable you to use only one 'clip region' without having to do anything fancy.
    If you need to do the same thing for arbitrary geometry, you're better off using a stencil buffer. You can draw each polygon to the stencil buffer with GL_INCR, then you can test against it with GL_EQUAL with the value N, where N is the number of polygons. i.e. if you draw 5 polygons, with each incrementing the stencil buffer, then only pixels which are contained within every polygon will have a value of 5.
    Reply With Quote Edit / Delete Windows 7 Show Events

  6. Post #2166
    Gold Member
    Xeon06's Avatar
    September 2005
    1,223 Posts
    I'm trying to interact with javascript on a website through a windows form, and it occured to me that VB.NET (shut up) might not be the best option to use. What other things could I use for javascript interactions?
    PhantomJS
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Useful Useful x 1Agree Agree x 1 (list)

  7. Post #2167
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    Do you think it would be worth it to have my own forums for my mod? Even if it's a small group of devs that I talk to that post there, I'd kinda like my own place to dump shit that isn't Facepunch.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 8 (list)

  8. Post #2168
    Facepunch Staff
    layla's Avatar
    March 2010
    2,580 Posts
    I love your mod but it's not really that popular yet. It's really cringe when people make forums that hardly anyone would use.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 28 (list)

  9. Post #2169
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    I love your mod but it's not really that popular yet. It's really cringe when people make forums that hardly anyone would use.
    This is exactly why I'm thinking I shouldn't. Anyway, that was quick enough feedback for me. Thank you, guys.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 11 (list)

  10. Post #2170
    Gold Member
    thomasfn's Avatar
    July 2008
    2,965 Posts
    This is exactly why I'm thinking I shouldn't. Anyway, that was quick enough feedback for me. Thank you, guys.
    You could make a forum thread here in programming, I'd be sure to follow it.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 7Friendly Friendly x 1 (list)

  11. Post #2171
    Gold Member
    Naelstrom's Avatar
    June 2010
    2,758 Posts
    This is exactly why I'm thinking I shouldn't. Anyway, that was quick enough feedback for me. Thank you, guys.
    A blog wouldn't hurt; even if it's not popular a blog doesn't rely on other users for content, and can easily gain popularity.
    Reply With Quote Edit / Delete Linux United States Show Events Agree Agree x 8Friendly Friendly x 1 (list)

  12. Post #2172
    kill yourself
    Protocol7's Avatar
    June 2006
    26,086 Posts
    Man, I've been reading up on how Java works.

    It's kind of cool.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 5Disagree Disagree x 3Funny Funny x 3Informative Informative x 1 (list)

  13. Post #2173
    Gold Member
    synthiac's Avatar
    June 2007
    1,100 Posts
    "java works"

    that's like an oxymoron.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 38Zing Zing x 3Dumb Dumb x 2 (list)

  14. Post #2174
    kill yourself
    Protocol7's Avatar
    June 2006
    26,086 Posts
    I guess that's why the government uses it
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2Zing Zing x 1 (list)

  15. Post #2175
    mutated's Avatar
    October 2010
    1,537 Posts
    so the government "works"

    that might actually be a worse oxymoron
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 19Zing Zing x 2Funny Funny x 2 (list)

  16. Post #2176
    CJF
    PieClock's Avatar
    August 2006
    16,445 Posts
    Not sure if I'm late, but any plans for releasing this?
    Yup, but not before I'm happy with how it works. But being completely honest here, its a slow program when importing and exporting so using it for huge pictures isn't going to work well.
    Reply With Quote Edit / Delete United Kingdom Show Events

  17. Post #2177
    Ask Rohan about rust keys!
    Bumrang's Avatar
    August 2011
    2,854 Posts
    I'm fucked up really badly on my Breakout game.

    I'm going to have to re-do the entire game.

    The entire [SUB]fucking[/SUB] [SUP]game.[/SUP]
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly x 16Artistic x 4Optimistic x 1Programming King x 1Informative x 1Funny x 1 (list)

  18. Post #2178
    Gold Member
    ZenX2's Avatar
    February 2009
    5,127 Posts
    Source control can fix that

    At least that's what I've heard
    Reply With Quote Edit / Delete Windows 7 United States Show Events Disagree Disagree x 3 (list)

  19. Post #2179
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,626 Posts
    so i ran across a very odd crash in box2d every once in a while but i didn't really think much of it

    today, i decided to crack down on it, thinking that i've been misusing box2d

    turns out i ran across some obscure bug that only a handful of other people encountered, and i found exactly one thread about it, and erin posted an unexplained code snippet there that fixes it

    glad to know it wasn't my fault
    Reply With Quote Edit / Delete Windows XP United States Show Events Funny x 8Informative x 4Dumb x 1Programming King x 1Agree x 1 (list)

  20. Post #2180
    Ask Rohan about rust keys!
    Bumrang's Avatar
    August 2011
    2,854 Posts
    Source control can fix that

    At least that's what I've heard
    That would've been no use for me, the tutorial that I used for the base of the program wouldn't quite fit with breakout.

    I used this for starting my game but it all just spiraled down in the end.
    Why did I use it?

    Well, for me it was kinda like this: Lets say you have an idea for something to draw. You get out a piece of paper and get a pen but, you just can't put your pen down and actually start it.

    Same here, I didn't know which part of the program to start with. My last game (Pong) was a complete monstrosity     at least it was a full pong game even with changing ball speeds    . I had EVERYTHING in main.cpp. That's right, no classes. Not only that, but the movement didn't depend on time or framerate. So when I got off the slow laptop I was developing on and got on my desktop I couldn't even see the ball .

    So Facepunch, when you start a new game, what's the first thing you start with? That's pretty much all I need to start again right now.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  21. Post #2181
    Gold Member
    Naelstrom's Avatar
    June 2010
    2,758 Posts
    Sweet freetype is amazing. (Click for full view)

    Font rendering with full anti-aliasing, hinting, kerning, (I think it's unicode too?)etc.
    Freetype made it a piece of cake to do too, without it I'd be stuck with my little hand-made tilesets.

    Edited:

    So Facepunch, when you start a new game, what's the first thing you start with? That's pretty much all I need to start again right now.
    I like to work on little 'modules' where I can code it once and use it in all of my projects. For example this freetype wrapper I made lets me render text on screen. I can use this in any future project I want, improving it when I see it's unfit.

    I think it's a really rewarding and fun way to tackle making a program.
    Reply With Quote Edit / Delete Linux United States Show Events Winner Winner x 2Artistic Artistic x 1 (list)

  22. Post #2182
    Map in a box's Avatar
    July 2009
    7,419 Posts
    Apparently my body decides to get a flu-like disease. Stop the presses!

    Edited:

    Stencil testing?

    If you just want to calculate the intersection of a bunch of axis-aligned rectangles in 2D space, you can take the minimum of their maximum x- and y- coordinates and the maximum of their minimum x- and y- coordinates. This would enable you to use only one 'clip region' without having to do anything fancy.
    If you need to do the same thing for arbitrary geometry, you're better off using a stencil buffer. You can draw each polygon to the stencil buffer with GL_INCR, then you can test against it with GL_EQUAL with the value N, where N is the number of polygons. i.e. if you draw 5 polygons, with each incrementing the stencil buffer, then only pixels which are contained within every polygon will have a value of 5.
    I'll only clip rectangles.
    Reply With Quote Edit / Delete Windows XP United States Show Events Friendly Friendly x 3 (list)

  23. Post #2183
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    Sweet freetype is amazing. (Click for full view)

    Font rendering with full anti-aliasing, hinting, kerning, (I think it's unicode too?)etc.
    Freetype made it a piece of cake to do too, without it I'd be stuck with my little hand-made tilesets.

    Edited:


    I like to work on little 'modules' where I can code it once and use it in all of my projects. For example this freetype wrapper I made lets me render text on screen. I can use this in any future project I want, improving it when I see it's unfit.

    I think it's a really rewarding and fun way to tackle making a program.
    For the C# people here, I've been working on cross-platform FreeType bindings for .NET, which enables you to do write a similar system in C# without having to use any unmanaged/unsafe code in your project.

    https://github.com/Robmaister/SharpFont

    Edited:

    I'm going to eventually write some OpenGL examples with OpenTK, I'm still writing the bindings, but the high-level API is working pretty well.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Winner Winner x 2Programming King Programming King x 1 (list)

  24. Post #2184
    dajoh's Avatar
    March 2011
    625 Posts
    My GUI system has hit a hault. Slick2D doesn't have support for "stacked" clips. Can you do this in OpenGL?
    If I understand you correctly, you want to be able to do something like this:
    Push Clipping Region (100,100,200,100) (x,y,w,h)
    Push Clipping Region (25,25,50,10) (new real clipping region is 125,125,50,10)
    Pop Clipping Region (new real clipping region is 100,100,200,100)

    If so, all you need to do is create a class with push/pop methods to apply the new clipping region every time you use them.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  25. Post #2185
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    -snip-
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  26. Post #2186
    chimitos's Avatar
    September 2010
    2,378 Posts
    The mix and reset buttons work now.
    Also I figured out how ads work.



    Now for a menu, tutorial thing, and icon.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Winner Winner x 1 (list)

  27. Post #2187
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,626 Posts
    holy shit coding at 2am half asleep is hard! but sometimes you just need something to be done in the morning
    Reply With Quote Edit / Delete Windows XP United States Show Events Programming King Programming King x 15Agree Agree x 3Dumb Dumb x 1 (list)

  28. Post #2188
    Felheart's Avatar
    June 2011
    366 Posts
    holy shit coding at 2am half asleep is hard! but sometimes you just need something to be done in the morning
    Thats the spirit! Programming King for you!
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Friendly Friendly x 8Agree Agree x 1 (list)

  29. Post #2189
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Almost all code generation is like that, even with optimization on. It'd be extremely difficult to write a compiler that could take all the possible combinations of methods into account and generate "perfect code". This is why lower level code is almost always faster.
    are you serious

    Edited:

    so this is essentially what the assembly posted by tobba does:

    struct foo {
        int a;
        int b;
    };
    
    int get_b(struct foo* ptr)
    {
        int b = ptr->b;
        return b;
    }
    

    with no optimization, this is what gcc does:

    Code:
    _get_b:
    push ebp
    mov ebp, esp
    sub esp, 0x18
    mov eax, [ebp+0x08]
    mov eax, [eax+0x04]
    mov [ebp+0xf4], eax
    mov eax, [ebp+0xf4]
    leave
    ret
    at -fomit-frame-pointer -O3, this is what gcc does:

    Code:
    _get_b:
    mov eax, [esp+4]
    mov eax, [eax+4]
    ret
    that's as compact as you can get without inlining (which gcc does anyway)
    Reply With Quote Edit / Delete Mac Australia Show Events Informative Informative x 4Useful Useful x 1 (list)

  30. Post #2190
    Gold Member
    Robber's Avatar
    January 2006
    6,206 Posts
    Link us. I bet it's hilarious.
    It's not.
    We're looking for:
    Microsoft .NET (C#, VB)
    WPF, XAML
    Java / C++
    Databases, SQL
    Reply With Quote Edit / Delete Windows 7 Austria Show Events Funny Funny x 1Agree Agree x 1Informative Informative x 1 (list)

  31. Post #2191
    Team Hamster
    jalb's Avatar
    December 2009
    588 Posts
    I try really hard not to waste everyone's time here by copy-pasting stuff from some of the stupid classes I take, but I thought this one was pretty funny:

    Which search technique is commonly used for searching in pathfinding and navigation algorithms in video games? (Points : 10)
    A+
    A*
    A$
    A-
    None of the above.
    Also while I'm at it:
    7. The order of a postorder traversal of a binary search tree. (Points : 3)
    Is that even a question?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 14Programming King Programming King x 1 (list)

  32. Post #2192
    Follow me on github!
    benjojo's Avatar
    January 2009
    2,622 Posts
    are you serious

    Edited:

    so this is essentially what the assembly posted by tobba does:

    struct foo {
        int a;
        int b;
    };
    
    int get_b(struct foo* ptr)
    {
        int b = ptr->b;
        return b;
    }
    

    with no optimization, this is what gcc does:

    Code:
    _get_b:
    push ebp
    mov ebp, esp
    sub esp, 0x18
    mov eax, [ebp+0x08]
    mov eax, [eax+0x04]
    mov [ebp+0xf4], eax
    mov eax, [ebp+0xf4]
    leave
    ret
    at -fomit-frame-pointer -O3, this is what gcc does:

    Code:
    _get_b:
    mov eax, [esp+4]
    mov eax, [eax+4]
    ret
    that's as compact as you can get without inlining (which gcc does anyway)
    (I really have no idea if this idea would make any sence)
    But does that mean if you let gcc run over skyrims bin's then you could end up with a ~faster~ game.
    Reply With Quote Edit / Delete United Kingdom Show Events Dumb Dumb x 3 (list)

  33. Post #2193
    Gold Member
    Darwin226's Avatar
    January 2009
    4,159 Posts
    (I really have no idea if this idea would make any sence)
    But does that mean if you let gcc run over skyrims bin's then you could end up with a ~faster~ game.
    You'd need the source, after you have the binaries the damage is already done.
    And I doubt it would be faster.
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events

  34. Post #2194
    Gold Member
    Robber's Avatar
    January 2006
    6,206 Posts
    You'd need the source, after you have the binaries the damage is already done.
    And I doubt it would be faster.
    Why?
    Reply With Quote Edit / Delete Windows 7 Austria Show Events Agree Agree x 1 (list)

  35. Post #2195
    Kamshak's Avatar
    July 2008
    438 Posts
    it would probably not even run, optimisations are always a bit critical, sometimes they lead to invalid code and bugs due to faulty optimisation are extremely difficult to track down. Also a few instructions more or less don't always make much of a difference, most of the load is on the graphics card anyway so i doubt you'd have any notable performance increase
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Disagree Disagree x 4 (list)

  36. Post #2196
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    it would probably not even run, optimisations are always a bit critical, sometimes they lead to invalid code and bugs due to faulty optimisation are extremely difficult to track down. Also a few instructions more or less don't always make much of a difference, most of the load is on the graphics card anyway so i doubt you'd have any notable performance increase
    i'm sure if you patched out that particular function with some other code (and padded out the rest of the function after ret to keep the same size) it'd work fine

    whether you'd see any perf gains is a different story
    Reply With Quote Edit / Delete Australia Show Events Agree Agree x 2 (list)

  37. Post #2197
    Map in a box's Avatar
    July 2009
    7,419 Posts
    If I understand you correctly, you want to be able to do something like this:
    Push Clipping Region (100,100,200,100) (x,y,w,h)
    Push Clipping Region (25,25,50,10) (new real clipping region is 125,125,50,10)
    Pop Clipping Region (new real clipping region is 100,100,200,100)

    If so, all you need to do is create a class with push/pop methods to apply the new clipping region every time you use them.
    I can get the world position of panels, and I have a push/pop method that is ready to have some code put into it.
    But look, here is the problem with your method:
    I can't have subpanels clip and their parents with a different clip. That's why I can't just use g.setWorldClip, because you can't "stack" the clips.
    Reply With Quote Edit / Delete Windows XP United States Show Events

  38. Post #2198
    calzoneman's Avatar
    February 2008
    460 Posts
    so i ran across a very odd crash in box2d every once in a while but i didn't really think much of it

    today, i decided to crack down on it, thinking that i've been misusing box2d

    turns out i ran across some obscure bug that only a handful of other people encountered, and i found exactly one thread about it, and erin posted an unexplained code snippet there that fixes it

    glad to know it wasn't my fault
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 58Agree Agree x 16 (list)

  39. Post #2199
    Gold Member
    Downsider's Avatar
    July 2007
    2,018 Posts
    I can get the world position of panels, and I have a push/pop method that is ready to have some code put into it.
    But look, here is the problem with your method:
    I can't have subpanels clip and their parents with a different clip. That's why I can't just use g.setWorldClip, because you can't "stack" the clips.
    Are you trying to say that clipping only applies to the final raster?
    Reply With Quote Edit / Delete United States Show Events

  40. Post #2200
    Map in a box's Avatar
    July 2009
    7,419 Posts
    Are you trying to say that clipping only applies to the final raster?
    If I understand you right, yes. I can only use 1 clip. I'll make a bug report to avoid using OpenGL(seems more hacky than its worth)
    Reply With Quote Edit / Delete Windows XP United States Show Events Dumb Dumb x 2 (list)