• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About HalfLucifer

  • Rank
  1. Sorry for my novice question that might appear once in a while. I did search up forums but failed to find a thread that have detailed explanation about it. I noticed that many 2d games packed sprite animations into one big image file which is none-power-of-two dimension. However, using glBindTexture() on a NPOT texture would kill performance immediately. The method I figure out might work is: (I utilize DevIL to load images) 1) Load the big NPOT image into a data buffer. 2) Use ilCopyPixel() to copy each region of animation frame to individual buffers. 3) Construct a sprite/quad and bind a blank POT texture(32x32, 64x64, etc) on it. 4) Use glTexSubImage2D() to replace the blank texture totally with animation frame buffers as needed. Is there a catch? Currently I target on OpenGL 1.1 only. Is there other method more efficient/effective to do? Texture matrix? Image scaling? Or NPOT extension?
  2. Splendid! It does work! It's a pity that there's no vorbisfile port. I think I have to make use of vorbis to decode memory lumps. I'll definitely take some time investigating it. Thanks! BTW, still I wish there's a more active project/source for C# OggVorbis, or to make it the native supported format in OpenAL. ;)
  3. Hi there, I managed to use ov_open() for Ogg decoding in C#. My Ogg decoder is written in C++/CLI and directly called by C# native code. Now I have to make it possible for memory lump, which is represented as byte[], to decode with. Since ov_open() can only accept FILE structure opened by fopen(), I see that I have to use ov_open_callbacks() for custom file manipulation. How can I pass the required function pointers into it for custom manipulation? I tried to pass delegate then cast it into function pointer, but it doesn't work. Have someone implemented this feature before? Any comment or suggestion? Thanks.
  4. [.net] Installer for Game

    Quote:Original post by Dave Hunt You can create a shortcut directly to the "msiexec /x ..." command in the same way you can create a shortcut to a batch file. No voodoo needed. Hi, I can only add folder, project output, file or assembly on Setup Project. What do you mean by 'directly create a shortcut to the "msiexec /x [ProductCode]"'?
  5. [.net] Installer for Game

    Have anyone tried the Setup Project on VS2005? I found it extremely easy to pick up with user interface arrangement, registry setup, launch condition check, and file system support. However, I haven't figure out how to add Uninstall functionality in user's program menu. It would be nice if user can directly uninstall your program from the program menu. Does anyone know how to implement it?
  6. I have a 3d application written in C# and MDX. Now I'd like to port it to MacOSX. I look for many libraries/engines for the best possibility to port. Personally I like Irrlicht very much for its clear API usage, nice documents/tutorials, and stable implementations. It's just too sad that Irrlicht.NET does not support Mono. Therefore, I'm planning to use Mono with Tao Framework. Wrap up (ouch!) Tao.OpenGL to substitute for MDX. Use Tao.GLFW for Mac window handling and input polling. Use OpenAL or SDL to substitute for DSound. Are those substitutes feasible and stable enough? Please correct me if I was wrong or miss something. One additional question: Once I compile all source files to get an EXE with Mono's mcs.exe, is it already executable in MacOSX with all dependent DLLs?
  7. I wrote a .NET application with MDX using VS2005. Sometimes when I press F5 to launch the debugger, there's a good chance that debugger will get stuck in startup session loading DLLs. Application is not up. Form is not shown. No response at all. Soon VS2005 will get in busy state too. I thought it was my fault that some resources are not properly disposed when I start debugger last time, but it seems not what I thought. I can't do anything but to restart debugger (once or a couple of times) to get it run normally. Has anyone come across this same situation? Any suggestion for this problem? Many thanks.
  8. [.net] From void* to byte[] ?

    Thanks! Finally I correct my wrong concept about using unmanaged memory. I'll figure out Tao's work some time for sure.
  9. [.net] From void* to byte[] ?

    Thanks for your reply! Marshal class is what I really need. Here's my solution: Int32 ReadCurrentFile(IntPtr file, IntPtr buffer, UInt32 len); byte[] buffer = new byte[bufferSize]; IntPtr ptrBuffer = UnsafeAddrOfPinnedArrayElement(buffer, 0); int readSize = ReadCurrentFile(file, ptrBuffer, bufferSize); Marshal.Copy(ptrBuffer, buffer, 0, readSize); MemoryStream ms = new MemoryStream(buffer); And, thanks for the #ZipLib info. It's very useful! I used to do zip work with zlib/minizip in C, though, now I've downloaded #ZipLib. It looks pretty neat and intuitive. I'm sure I'll try it out!
  10. I'm trying to use an existing zip library written in C to write and read binary data from files. I managed to call library routines correctly by p/invoke method. When reading back binary data, I consider that MemoryStream class would be a right one to use. The question is, however, what I read from the old C library routine back is a void* type buffer that I failed to figure out how to appropriately match it to a byte[] array for MemoryStream class. The original routine signature in C: int ReadCurrentFile(FILE *file, void *buffer, unsigned int len); My p/invoke routine signature in C#: Int32 ReadCurrentFile(IntPtr file, out IntPtr buffer, UInt32 len); Any ideas or suggestions?
  • Advertisement