TangentZ

Members
  • Content count

    1188
  • Joined

  • Last visited

Community Reputation

450 Neutral

About TangentZ

  • Rank
    Contributor

Personal Information

  • Interests
    Design
    Programming
  1. Serializer/Endian

    If you want to be portable and don't want to mess around with endian detection, you can just use the ntoh* and htonl* family of functions.   htons, htonl, htonf, htond - (H)ost TO (N)etwork short, long, float, double ntohs, ntohl, ntohf, ntohd - (N)etwork TO (H)ost short, long, float, double   Network is always big-endian.  The host is whatever you code is running on, can be little or big.
  2. OpenGL Learning modern OpenGL

    Like you, I learned the old OpenGL 1.4 style API, and left it for a few years.  Coming back to graphics programming now, I've found that OpenGL has changed quite a lot!   There is always the newest edition of the OpenGL Programming Guide (8th Edition!).   As for myself, I've found the OpenGL Intorduction (http://www.open.gl) tutorials quite useful for "catch up".   For shaders, you'd want to learn the GLSL, say the OpenGL Shading Language Cookbook.   Hope this helps!
  3. Have you tried DevIL? It's very easy to load PNG into OpenGL texture. DevIL even has a syntax similar to OpenGL.
  4. C++ database extension

    Have you looked at Database Template Library? It doesn't quite do what you want (extend the C++ syntax), but it sure makes C++ database programming much easier.
  5. This is a somewhat tricky thing to do in XSLT. Try this: <xsl:template match="table"> <xsl:apply-templates select="text() | *"/> </xsl:template> <xsl:template match="text() | * | @*"> <xsl:copy> <xsl:apply-templates select="text() | * | @*"/> </xsl:copy> </xsl:template> It should preserve everything under "table", tags and all. Hope this helps.
  6. Visual C++ Without SP2

    Yes, you can install VS 2005 and MSDN for VS 2005 on XP without SP2. Try it at your own risks.
  7. [.net] Help with C# generics

    You may want to check out the section on generic type constraint of the C# Programming Guide.
  8. XML Problem

    Are you sure that in your "Games.xml", the chapter node has a "name"? The exception is saying that you don't.
  9. WinXP protects the files in the system/sytem32 directories by keeping a cache of them in a hidden system directory. That's why they keep coming back. It is not a good idea to copy the files to there anyhow (DLL Hell!). An alternative is to place the Mesa DLLs in same directory as your EXE.
  10. Java: multiple action listeners

    Quote:Original post by ju2wheels Its the last action listener added that gets called first and then the next one in line in reverse order from that in which they were added. It is not a good idea to depend on this behavior. What if they decide to use a hash table to store the listeners in the next version? It will not be LIFO anymore. Quote: Is there a way to reverse this order without actually changing the order in which i add them? Think about why you need to have the listeners notified in a specifc order. Normally, you shouldn't care.
  11. static variables (from "Thinking in C++)

    Since FileStatic.cpp #includes FileStatic2.cpp, they are really one and the same "translation unit" to the compiler. So the variable "fs" is accessible to func(). Try taking out the #include "FileStatic2.cpp", compile the two CPPs separately, and then link them to create the executable. You'll get a linker error.
  12. Quote:Original post by Geronimo2000 I am trying to invoke Control.SetBoundsCore in a C# program with reflection via the MethodInfo class. The function is behind called, but it's virtual-ness is propogating the call back down to my derived Form class, and that's no good at all. What do you mean no good at all? That's the way it (Object-Oriented Programming) is supposed to work... Quote: To explain a bit, I am trying to get around the Form.SetBoundsCore function by overriding SetBoundsCore in my derived Form class, and then essentially calling Control.SetBoundsCore with reflection. What is going on here? I'm lost. Quote: The last piece of the puzzle with my current approach is making the MethodInfo.Invoke call somehow ignore the virtual-ness of Control.SetBoundsCore (sort of like how it happens every time you call base.XXX from an arbitrary override function). Why are you fighting the very foundation of OOP (polymorphism)? [looksaround] Quote: Any one solved this type of problem already? What is the real problem you are trying to solve?
  13. (C#) File Input/Output, I need help.

    You can use the Split() method of the String class. using (StreamReader reader = File.OpenRead("MyFile.txt")) { string line; char[] delimiter = new char[] { ' ' }; while ((line = reader.ReadLine()) != null) { string[] tokens = line.Split(delimiter); firstName = tokens[0]; lastName = tokens[1]; // etc } }
  14. Checking the return value of new

    Another thing to consider is that if you get a NULL or the exception is thrown, your application is in big trouble anyhow... What is to guarantee the Log(...) will succeed? [smile]
  15. inline methods in VC++

    Quote:Original post by roos Thanks guys. I think your explanation is correct, Connor. So I'll just put the definitions below the class declaration, but still in the header file as I do for templates. Also I have heard that inline is only a hint, but as far as I know, the compiler doesn't completely ignore it, right? In that case, it seems like inlining functions is still worth something. roos It might help you understand "inline" better if you read Inline Redux and Guru of the Week #33 written by Herb Sutter.