Author Topic: Stuff that fries your potatoes with olive oil of HAPPY.  (Read 655422 times)

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1950 on: January 15, 2012, 01:50:52 PM »
Considering engines are continually written without resorting to using inline assembly, odds are there is a faster and processor-agnostic way of doing it.  Once again, there is not a single line of assembly in Doom 3 and that engine is fast as hell.

XNA is dying?  Where'd you hear that?  There are numerous games on Steam created using XNA, Windows Phone games are based on XNA, and every Xbox 360 indie game in the market place is written using XNA.  XNA is most definitely not part of DirectX, either, aside from using it as a renderer.  It's related to DirectX about as much as SDL is.

Regardless of how often you have to use a line like that, it doesn't change the fact that no proper managed library should require you to do that.  Not only does that involve essentially bypassing the CLR, but it would also become a debugging nightmare if something were to go wrong.  I'm not saying it's anything you did, it's something that's unacceptable on the SdlTtf side.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1951 on: January 15, 2012, 05:25:41 PM »
Well Tao is basically a binding for SDL among other things for managed environments, and without resorting to stuff like that things would require some messy work inside Tao. Also, the I read a blog article talking about DX and XNA and how basically neither of them are likely to survive the transition to Win8 when it comes. I know full well that's not a good reason to not want to use them, but from the limited experience I've had managed DirectX is a complete nightmare.

All things considered that's not such a horrible line anyway. All you're really doing is saying "well this native code uses a pointer to a struct, so I'll create a pointer, and grab the struct from it."

It's basically just dereferencing a pointer, but since CLI code generally stays away from doing that they've made it lame.

I'd rather deal with pointers in CLI code than deal with a horribly mangled c# binding for something. I tried one of the Curses bindings for C# a little while bad and god was it a fucking nightmare. Missing functions who's functionality had been packaged into other functions, renamed functions calls, the entire API had been essentially rewritten... Poorly. I'd rather be able to follow the documentation for the original API and still be able to call the same functions in my C# binding, even if it means I've gotta do some funky pointer stuff.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1952 on: January 15, 2012, 11:32:24 PM »
Yeah, I wouldn't trust that source.  Considering how ingrained XNA is in the Windows Phone and Xbox 360 DNA, I really don't see it going anywhere anytime soon.  The beauty of it is that it can even work for Windows 8 tablets without a problem, since it's all managed code.  You can very easily write one set of code that works perfectly well with both Windows (from XP to 7) and the Xbox 360, and with a bit of addition work make the same code work with Windows Phone (though that uses a subset, obviously, so advanced shaders and XACT sound will not work).

And yeah, managed DirectX was a nightmare.  Fortunately, it went away quickly.

As for the code, dealing with memory is not something that any managed code should have to do.  When you do any sort of direct memory manipulation it jumps outside of the confines of the managed environment.  The second you touch memory directly is when you start having to deal with endian issues and how long the native code that you're trying to nurture into working thinks that an "int" is.  The moment you escape that sandbox, you're losing out on some of the biggest benefits of using managed code in the first place.

And yep, there are some terrible .NET bindings out there.  I've used a bunch of them myself.  I remember using one OpenGL binding that renamed a bunch of functions.  I can't remember off-hand which one that I used semi-recently (read: something like six months ago), but it was quite good.  The best part about it is that it made great use of what .NET offered while still leaving everything similar enough that you could port C/GL code over without much of an issue.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1953 on: January 16, 2012, 11:42:25 AM »
Well, the Tao binding seem to be rather good, aside from the times when you need to work with pointers.

It doesn't seem to have renamed or removed any OGL functions, and the SDL stuff seem to work rather well, aside from the small nagging question of why it seems to want to use Apple.Foundation when I call SDL_Init()  (and subsequently thrown an exception... which doesn't seem to adversely affect the rest of my program).
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1954 on: January 16, 2012, 07:10:32 PM »
With regards to the Apple.Foundation thingie, my guess is that it does that for Mono compatibility.  SDL will happily create a window for whichever operating system that you're using.

My best guess is that Mono doesn't translate Windows.Forms very well to the Aqua user interface (the menu structure for OS X is far different than Windows and X applications), so it probably tries to pop open a native Apple window first and only tries Windows.Forms (or possibly even something like GTK.NET) after that fails.  It probably made more sense for them to handle it with exceptions than to make a possibly error-prone assumption about which OS the user is using.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1955 on: January 16, 2012, 07:35:58 PM »
Yeah, sounds plausible.

It's catching the exception and not failing, so that's probably it.

What I've been doing has been kinda cobbled together with a mixture of example some using .net in an OSX environment and some using C++/CLI etc.

It's nice to know I can translate managed C++ to C# relatively easily. Makes me feel good about my ability to at least read and make sense of code.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1956 on: January 16, 2012, 11:35:06 PM »
And that's exactly what I love about C#.  You get the rapid development features of VB.NET with the terse syntax of C#, plus the benefit of being able to easily port over most C++ code without too much of an issue.

I haven't dealt with managed C++, but it looks kinda weird.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1957 on: January 17, 2012, 09:05:27 AM »
Yeah, it has some weird features. I've loved working with C# since I started working with it. I Started with learning C++, then learned Java thanks to a class in highschool, so C# felt like a natural progression.

Plus, the C# intellisense spoils you so much, lol. After trying to do some C++ I realized how reliant I am on intellisense, lol.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1958 on: January 17, 2012, 09:12:09 PM »
Oh, I know.

Intellisense usually manages to not get in your way, either. One of my biggest complaints about Eclipse is that it tries to code everything for you. It can get very frustrating.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1959 on: January 18, 2012, 09:46:48 AM »
I was more talking about how in C++ in VS2010 intellisense does not pop up the moment I start typing, it doesn't have all the reserved words, it doesn't try to guess what your about to type to complete it for you in many cases.

Even just using constants it won't pop up to help you complete the constant, which can be a pain. Overall it' just not as helpful in C++ as in C#.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1960 on: January 18, 2012, 08:02:17 PM »
I've had pretty much the opposite experience with it, to be honest.  C++ is highly dependent on the Intellisense database being updated, so if it's not updating for whatever reason (for whatever reason, it stays really up to date on my desktop but always lags behind on my laptop -- I'm almost positive that it throttles it based on your CPU speed).

C++ is insanely hard to do that sort of thing on.  C# is a bit more predictable.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1961 on: January 18, 2012, 10:46:19 PM »
I do understand that C++ is harder, and I don't fault them for not having intellisense pop up the moment I begin typing anything anywhere, but I'm so used to it in C#. I basically don't remember fuck all, and just use intellisense to explore the existing libraries looking for something that should do what I want.

I'm actually serious too, instead of looking stuff up on the MSDN I usually just browse through stuff in intellisense. I usually have some idea where to look to find it, so being able to confirm stuff by popping up the intellisense entry for it and reading the tooltip is immensely helpful. And since they use enumerations rather than just "#define"ing constants its easy to locate constants as well.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1962 on: January 19, 2012, 12:17:25 AM »
I was mainly just saying that in some situations Intellisense works quite well on C++.  That being said, I'm not sure exactly what makes it that way.  I haven't looked closely enough at it to find out.

Yeah, I usually do that, too.  The Intellisense documentation is usually at least passable for the Microsoft components.  If there's anything too vague, it's nice that you can mash F1 and pull up MSDN to get the full documentation.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1963 on: February 15, 2012, 11:26:05 PM »
Replacement laptop keyboard came today. Took no time to replace the old one, and I love the new one. Only thing that kinda messes me up is that the enter, \ and / keys are laid out a bit differently. On my old one there was a second \ key between the Z and shift, and there was a smaller \ key and the enter key was one of those weird backwards L shaped ones that takes up double the height of a normal one with the slightly larger bottom half.

But still, I'm so happy that this thing is here.

Also, I've ordered a USB cable for my wireless Xbox controllers from some chinese company for like $5, should arrive in the next little while. Hopefully it works, because I can't stand playing kingdoms of amalur without an xbox controller now. I've been borrowing a wired one from my GF's roommate when I'm at her place.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

OmegaOmni

  • Bernard Deathrage Advocate
  • Hero Member
  • *
  • Posts: 1560
  • I am here to fuck the scout's mother.
    • View Profile
Re: Stuff that fries your potatoes with olive oil of HAPPY.
« Reply #1964 on: February 18, 2012, 12:09:28 AM »
GOT MY ORDERS TO LEAVE SHEPPARD!