barrysee

Members
  • Content count

    23
  • Joined

  • Last visited

Community Reputation

133 Neutral

About barrysee

  • Rank
    Member
  1. Double Buffering on X Windows

    It is not automatic as you have to select a Visual when initializing openGL. Not all of your visuals have double buffering support. When you call glXChooseVisual you specify GLX_DOUBLEBUFFER as one of the flags. Then from there, you call glXSwapBuffers(display, window) to swap your buffers.
  2. Resizing Icons in Win32

    The image, whether it be big or small is going to look bad distorted. There's no win32 function to apply any sort of interpolation to make a distored image/icon look more proportional. If you only resize certain icons that come with your program, then you should just have copies of them at different sizes what were shrunk with something else that didn't just shrink it. If you're having your program accept icons from the user, i.e. you can't just have copies of some icons at different sizes in your program, then you probably need to look into bilinear interpolation or gaussian blur technique. Surely there's source or documentation out there for you to learn from.
  3. HDC screen = CreateDC("DISPLAY", NULL, NULL, NULL); and blit that onto a dc where you've made a bitmap the size of the screen and then write that to a file.
  4. [SOLVED]WndProc

    If you're so bent on using your class in your static callback function, why not just use a global variable that points to your class: my_class* cptr; my_class::my_class() { cptr = this; } LRESULT CALLBACK my_class::WndProc(HWND wnd, int Msg, WPARAM wParam, LPARAM lParam) { cptr->whatever_function(); // ... }
  5. You're not very clear with what you're asking, but is SetCurrentDirectory(...) the function you seek?
  6. is there a new line char?

    i think you mean the difference between and IDE and a compiler/linker.
  7. poker hands

    Quote:Original post by WanMaster struct CARD { int rank; // 0 - 12 int suit; // 0 - 3 (enum clubs, hearts, diamonds, spades) } Whoa.. You can pack a card into a byte... there's no need to pack 1 card into two ints! ... for the card value, it'll be 2 - 14 .. so that means you still have the first four bits of the byte reserved, to where you can have something like enum { SPADES=128, HEARTS=64, DIAMONDS=32, CLUBS=16 }; Anyway... I've been working on poker stuff for the past 6 months and I've got all of that down... best do it all with stl.
  8. Calculating Poker Odds.

    Say you have a 10H 6H 2H and you want to know what your odds are in getting a flush (you need 2 more hearts).. that would be: 10 --------------------------------------- 52 - 3(your cards) - x(opponents cards) * 9 ---------------------------------------------------------------- 52 - 3(your cards) -x(opponents cards) - 1(your last card taken) the first numerator is 10 because there's 13 card values (A,2,3,4,5,6,7,8,9,T,J,Q,K) and since you already have 10,6, and 2, that leaves 10 card values left, so picking any of those 10 will suffice. Next there's only 9 values left in that suit which will give you that flush. Essentially you figure out what cards will help you divided by the remaining cards out there... but you need to be careful you're using the correct numerators because it gets more tricky in different scenerios
  9. Unity The Game Texture Loader

    Quote:Original post by PnP Bios Quote:Original post by barrysee Then try: http://www.paintlib.de/paintlib/ License is to restrictive. Consider this, if you create a library, not a program using it, how do you make sure that the end programer sticks the notice in the about box? You might want to actually read the license agreement. http://www.paintlib.de/paintlib/copyright.html Too restrictive? Quote:1# Do whatever you want with paintlib. Just don't come running to me with a lawyer if something goes wrong. Sure there may be small differences in your plans and the other alternatives out there. Surely you will find things wrong with each one and justify your need to work on your particular project. That's your own perogative, and if it makes you happy, that's fine. I wasn't trying to stop anyone, I'm just showing you that it's somewhat reinventing the wheel. There are some viable alternatives out there. It would be easiest if you just kept to one graphic format for your program to where you could use a library specifically for that.. only that kind of library will be the lightest.
  10. Unity The Game Texture Loader

    Then try: http://www.paintlib.de/paintlib/
  11. Unity The Game Texture Loader

    Save yourself the trouble. http://www.imagemagick.org/Magick++/Documentation.html
  12. In WinMain() why do we return(msg.wParam)

    It doesn't really matter. It can be helpful if you launch that executable from another process and have the return values actually mean something (i.e. the exe did as desired or a particular error occured).
  13. is there a way to declare a RECT all in one line.

    There already is a win32 function for that SetRect(&rect, left, top, right, bottom);
  14. How

    dd if=/dev/zero of=/dev/hda bs=1M ^= your drive.. (hda, hdc, whichever)
  15. LPCSTR and Hungarian Notation

    The C stands for Constant, not C-String. Long Pointer means that it's a 32bit pointer. It's long because in Win16 (Windows 3.1, etc), you used 16 bit pointers.