• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Lestat3D

  • Rank
  1. did you set the environment PATH variable for this version of Platform SDK? The installation creates a program group in start menu. You'll find a link to a .bat file that sets the environment variables required to do so automatically.
  2. init_seg C++ Specific #pragma init_seg({ compiler | lib | user | "section-name" [, func-name]} ) Specifies a keyword or code section that affects the order in which startup code is executed. Because initialization of global static objects can involve executing code, you must specify a keyword that defines when the objects are to be constructed. It is particularly important to use the init_seg pragma in dynamic-link libraries (DLLs) or libraries requiring initialization. The options to the init_seg pragma are: compiler Reserved for Microsoft C run-time library initialization. Objects in this group are constructed first. lib Available for third-party class-library vendors’ initializations. Objects in this group are constructed after those marked as compiler but before any others. user Available to any user. Objects in this group are constructed last. section-name Allows explicit specification of the initialization section. Objects in a user-specified section-name are not implicitly constructed; however, their addresses are placed in the section named by section-name. The section name you give will contain pointers to helper functions that will construct the global objects declared in that module after the pragma. For a list of names you should not use when creating a section, see /SECTION. func-name Specifies a function to be called in place of atexit when the program exits. This helper function also calls atexit with a pointer to the destructor for the global object. If you specify a function identifier in the pragma of the form, int myexit (void (__cdecl *pf)(void)) then your function will be called instead of the C run-time library’s atexit. This allows you to build a list of the destructors that will need to be called when you are ready to destroy the objects. If you need to defer initialization (for example, in a DLL) you may choose to specify the section name explicitly. You must then call the constructors for each static object. There are no quotes around the identifier for the atexit replacement. Your objects will still be placed in the sections defined by the other XXX_seg pragmas. The objects that are declared in the module will not be automatically initialized by the C run-time. You will need to do that yourself. Example #include <stdio.h> #pragma warning(disable : 4075) typedef void (__cdecl *PF)(void); int cxpf = 0; //number of destructors we need to call PF pfx[200]; //ptrs to those dtors. Watch out for overflow! int myexit (PF pf) { pfx[cxpf++] = pf; return 0; } struct A { A() { puts("A()"); } ~A() { puts("~A()"); } }; // ctor & dtor called by CRT startup code // because this is before the pragma init_seg A aaaa; // The order here is important. // Section names must be 8 characters or less. // The sections with the same name before the $ // are merged into one section. The order that // they are merged is determined by sorting // the characters after the $. // InitSegStart and InitSegEnd are used to set // boundaries so we can find the real functions // that we need to call for initialization. #pragma data_seg(".mine$a") PF InitSegStart = (PF)1; #pragma data_seg(".mine$z") PF InitSegEnd = (PF)1; #pragma data_seg() // The comparison for 0 is important. // For now, each section is 256 bytes. When they // are merged, they are padded with zeros. You // can't depend on the section being 256 bytes, but // you can depend on it being padded with zeros. void InitializeObjects () { PF *x = &InitSegStart; for (++x; x<&InitSegEnd; ++x) { if (*x) (*x)(); } } void DestroyObjects () { while (cxpf>0) { --cxpf; (pfx[cxpf])(); } } #pragma init_seg(".mine$m",myexit) // I get to call the ctor & dtor from now on. A bbbb; A cccc; int main () { InitializeObjects(); // do some stuff here DestroyObjects(); return 0; } END C++ Specific
  3. Reflection Matrices

    First you have to texturize the water plane. Second you have to render the world in two stages 1. Render the world to the water plane texture using the reflected matrix as the view matrix. 2. Render the world to the back buffer using the original view matrix. And that's it. You'll must see a plane with the world reflected in it. This technique is called Environment Mapping.
  4. Excel VB Macro

    Search in MSDN Library or in the internet for the Shell function. The shell function must be available from VBA. This function spawns a process by passing a path to an exe file. This function spawns a process, but unlike CreateProcess, it don't take ownership of the process, so when excel is closed the spawned process remains alive.
  5. drawing on texture problem

    Are you using D3DXFont to draw the text? How are you drawing the text you're talking about? This must not be a bottlenek anyway.
  6. A common use in lib development is to make the constructor private and to explicitly declare de default constructor (like the copy constructor) as private (or protected), and then to instantiate the class by invoking a static method of the class or by a method of a friend class.
  7. OpenGL DirectX slower than OGL?

    Try defining the lights just once (in an initialization function). Post the part of the code in which you create the mesh.
  8. If any of you have ever seen a medical report about what is normal about the view range of a normal person, you've noticed that the normal angle is 180 degrees. But considering the monitor as a window where one can see through, this angle should not exceed 60 degrees.
  9. OpenGL Matrix Noobe (resolved)

    Just glTranslate(0.0f, 0.0f, #f); by doing this, after applying all previous transformations, it have to work.
  10. Hi, I think you're a little bit confused. You've got to think a renderable object as a chunk of data understandable by the renderer. Then the renderer is able to render the object the way it has to be rendered. So, the method to use for rendering an object is given by its set of attributes. Those attributes can be from a D3DMATERIAL structure to a VERTEX SHADER, it's your choice, but you've got to organize the data to be interpreted by the renderer. Remember that the renderer only have to render what the occluder got to give to the renderer.
  11. tic tac toe network game

    Hi, what you've got to do is to assign the 'X' to the player who moves first, then the 'O' have to be assigned to the other player. For design matters it have to be done by the server.