anist

Member
  • Content count

    494
  • Joined

  • Last visited

Community Reputation

100 Neutral

About anist

  • Rank
    Member
  1. splitting 16bit to 2 x 8bit

    in VC++ you can use HIBYTE or LOBYTE to extract the values (or use bit masks to construct equivalent macros). you can also just store the two values independently as char's.
  2. OpenGL Ummmm... A question

    Quote:Original post by Shenjoku okay question, how exactly does one get ahold of openGL for programming or just normal use even? I've been searching for hours and have yet to see a single download for any version of OpenGL that is useable. If you're using Visual Studio, you already have the libraries and headers. If you are using a different compiler, look at that compilers documentation. Search for NeHe on google to see how to link to the libraries.
  3. 2D classical form?

    Quote:Original post by patrick mccormick ...videogames experienced a period of classical 2D form... Two thoughts: 1) What the hell degree are you getting? 2) This sounds more like a perception you have of the state of the industry prior to 3D. It would be good to point out that this was as advanced as these games ever got because 3D brought new production standards. It may or may not have been an "enlightened" age though due to the fact that there was steady progress into this phaze followed by a abrupt near end of it (ie there was never a period of decline, more of an evolution into another form).
  4. C# in Business World

    ok, having said that C++ is in the minority in business, and reading through everyone else weighing in, i should mention: i do 3D graphics programming with OpenGL and C++ for a living. at this point in time, doing it in C# would be next to worthless, it is simply not fast enough. the idea that C/C++ is not worth learning or it's no longer appropriate for any job is typically put forward by those who are limited to the knowledge of their particular language. don't believe this nonsense. knowing assembly, C, and Win32 will make you a much better programmer. C# will simply get you hired doing shake and bake apps for local businesses. this is not a bad thing because we all have bills.
  5. C# in Business World

    In a word: yes. At least in my neck of the woods, C#, VB.NET and Java rule business development. C++ is one of the least common languages in this area.
  6. OpenGL OpenGL texture from DC

    GetBitmapBits works well to dump the DC into a buffer, then glTexImage2D.
  7. i don't think it really even matters if your billboarding.
  8. Quote:Original post by Anon Mike Stock fonts are generally poor choices...if the "standard" font ever changes thier app breaks. This means that the stock fonts can never change... are ugly bitmap fonts and have little to no support for internationalization. If you are writing an app and not doing the work to really make it work well with any font then you should probably just pick something and hard code it. If you're doing a professional international application that supported every font, you should not be here asking this question. You should be buying books on Win32 and studying them. But if you're not, just put in that one line of code.
  9. SendMessage(hWnd, WM_SETFONT, (HFONT)GetStockObject(SYSTEM_FONT), 1); the one line asnwer IIRC.
  10. don't know about anyone else, but i need a screenshot. :)
  11. How do you get your 3D model in the code?

    the quick answer is: Deep Exploration. it outputs OpenGL display lists, but it's not free. otherwise, write or download code that loads formats. there are a lot of 3DStudio max and .obj loaders out there, and it's fairly easy to write your own.
  12. it's hard to say, but try this: //glFont font GLFONT font; //Initialize OpenGL glClearColor(0.0, 0.0, 0.0, 1.0); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //Create font if (!glFontCreate(&font, "arial.glf", 0)) return false; //Initialize the viewport glViewport(0, 0, 640, 480); //Initialize OpenGL projection matrix glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, 640, 0, 480, -1, 1); //Clear back buffer glClear(GL_COLOR_BUFFER_BIT); //Draw some stuff glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glFontBegin(&font); glScalef(8.0, 8.0, 8.0); glTranslatef(30, 30, 0); glFontTextOut("Test string", 5, 5, 0); glFontEnd(); glFlush(); //new code glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); //now draw your items here //Destroy the font glFontDestroy(&font);
  13. char* to LPCWSTR

    there's an example on msdn. edit: also, no need to use microsoft specific in this case. i have found wstringstream to be help full. wstringstream wideversion; wideversion << "I am no unicode!"; MessageBox(NULL, wideversion.str().c_str(), _T("The following is in LPCWSTR format:"), MB_OK);
  14. Win32 C++ getting relative mouse movement

    just set it back to the middle of the window with SetCursorPos when ever you get a WM_MOUSEMOVE.
  15. the easy answer is magic number it over to where it is centered. the hard and robust answer: OpenGL does not support this and you have to make GDI calls (under Windows) to calculate your texts rectangle, then map that rectangle to your 2d projection coordinates in OpenGL. the GDI function is DrawText, with a DT_CALC_RECT passed in IIRC and the OpenGL function i typically use is gluOrtho2D (with the window size in pixels to map to pixelspace).