• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

1 Follower

About sobaka

  • Rank
  1. Hi all I am sure this is silly question but I couldn't find why it's not working. I am using lesson 17 with 2007 C++ Builder and it's working, but if I just change font color to black. [code] glColor3f(0.0f,0.0f,0.0f); // Set color to black[/code] i don't see the font it changes color to white. So my question is why this is happening and how can I overcome this issue. Any comment would be appreciated. Thanks in advance.
  2. [quote name='mhagain' timestamp='1314823070' post='4856024'] NeHe strikes again. Bitmap fonts use display lists internally; each character is a single display list (containing only 4 vertexes) and drawing many characters is going to result in many display list calls - in other words it's going to be not much faster than immediate mode. Additionally display lists will have some small overhead of their own, and your driver might just suck at them (an OpenGL driver is just obliged to support display lists - the spec says nothing about doing so efficiently!). Even assuming that your driver [i]doesn't[/i] suck at display lists, in order to get value out of them you really need to be pushing a [i]lot[/i] of commands and/or data in each list. And like I said, here we're talking about 4 vertexes tops (and who knows what kind of command wglUseFontBitmaps compiles into it's lists?) There are plenty of ways of getting text onscreen in an OpenGL application, and the right answer depends on whether or not you want anything fancy. A simple 256x256 texture containing the characters in a 16x16 grid, with texture coords to use derived from the character to be drawn is probably the most basic; if you need anything beyond that there are other solutions available. [/quote] Thank you for your reply. I need something simple and fast but preferably to be able to [size=2]change position, size, color, and not rotate with object. [/size] [size=2] [/size] [size="2"]I think it might be that my driver suck at display list. But I am not in control of what hardware or software end user will have on they machine so something stable working on most of the Windows XP and Windows 7 machines would be good enough for me. [/size] [size="2"] [/size] [size="2"]I have [/size][font=Arial, Verdana, Helvetica, sans-serif]Intel HD Graphics 3000 with up to 1696MB total graphics memory [/font] [font=Arial, Verdana, Helvetica, sans-serif]with OpenGL 3.0 if this is any help. [/font]
  3. [quote name='kdmiller3' timestamp='1314822580' post='4856023'] Many games draw text the same way they draw screen-aligned sprites: pack glyph bitmaps into a texture sheet and draw screen-aligned rectangles with appropriate texture coordinates. At a minimum you'll need texture coordinates (u0, v0, u1, v1) for each character, but you'll most likely want a position offset (x, y) so you can cut out empty space around glyph bitmaps and a width (w) so you can compute character positions and string widths more easily. For text that doesn't change often, you can build a draw list from your text rendering and use that draw list to render text until it changes. Protip: to ensure texels line up perfectly with pixels, subtract 0.5 from the integer vertex positions. (A half-texel shift compensates for bilinear filtering, but a half-pixel shift compensates for both bilinear filtering and multisampling.) [/quote] Thank you for your comment. By using texture map you loose control over the text and text usually ends up mixing with the images on the screen. I need easy way to write text on the screen with ability to change position, size, color and etc.. and preferably not rotate with the object, for which Bitmap Font is perfect but for unknown reason to me it sacrifices performance. I tried to using draw list but it didn't show any performance improvement, I am not sure either why it didn't. Is there any other good implementation of the Bitmap Font which would work faster ? Or anything similar to the Bitmap Font that would work fast?
  4. Hi everyone I simplified my project in order to work on the performance and I found out that Bitmap Font is responsible for some of the performance issues. So what I have is a standard cube and some text (you can check the image below to see what i mean). [attachment=5208:pav2dgl_snapshot.jpeg] When I render just cube everything responds fast (meaning translation and rotation of the cube), but once I add text it slows down depending from amount of text on screen (meaning if i have one or two its ok, but 15 or above performance drops a lot). Here is the code from my project which is responsible for the text. [code] void GLFont::BuildBitmapFont(HDC &hdc) { baseBitmap = glGenLists(96); // Storage for 96 characters fontSize = -MulDiv(fontSize, GetDeviceCaps(hdc, LOGPIXELSY), 72); fontBitmap = CreateFont( -fontSize, // Height of font 0, // Width of font 0, // Angle of escapement 0, // Orientation angle FW_NORMAL, // Font weight FALSE, // Italic FALSE, // Underline FALSE, // Strikeout ANSI_CHARSET, // Character set identifier OUT_TT_PRECIS, // Output precision CLIP_DEFAULT_PRECIS, // Clipping precision ANTIALIASED_QUALITY, // Output quality FF_DONTCARE|DEFAULT_PITCH, // Family and pitch "Courier New"); // Font name oldfontBitmap = (HFONT)SelectObject(hdc, fontBitmap); // Selects the font we want wglUseFontBitmaps(hdc, 32, 96, baseBitmap); // Builds 96 characters starting at character 32 SelectObject(hdc, oldfontBitmap); // Selects the font we want DeleteObject(fontBitmap); // Delete the font } void GLFont::glBitmapPrint(const char *fmt, int i, double size, double _x, double _y, double _z) { float length=0; // Used To Find The Length Of The Text float heigth=0; //Use To Find Heigth of the Text glPushMatrix(); glColor3f(0.0f, 0.0f, 0.0f); // set Color 2 white char text[256]; // Holds our string va_list ap; // Pointer to list of arguments if (fmt == NULL) // If there's no text return; // Do nothing glRasterPos3d(_x, _y, _z); va_start(ap, fmt); // Parses the string for variables vsprintf(text, fmt, ap); // And converts symbols to actual numbers va_end(ap); // Results are stored in text glPushAttrib(GL_LIST_BIT); // Pushes the display list bits for (unsigned int loop=0;loop<(strlen(text));loop++) // Loop To Find Text Length { length+=gmfBitmap[text[loop]].gmfCellIncX; // Increase Length By Each Characters Width heigth+=gmfBitmap[text[loop]].gmfCellIncY; } if (size < 0.1) glTranslatef(-size/2,-0.01, 0.0); // Center Our Text On The Screen else glTranslatef(-length/20,-0.03, 0.0); // Center Our Text On The Screen glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits glListBase(baseBitmap - 32); // Sets the base character to 32 glScalef(size, size, 0.0); glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); // Draws the display list text glPopAttrib(); glPopMatrix(); } [/code] So my question: Are theare any better way to render text on the scene without sacrificing performance? Or I am doing something wrong which causes performance drop? Any comment would be appreciated. Thanks in advance.
  5. glVertexPointer with vector

    [quote name='V-man' timestamp='1312160720' post='4842958'] Your vector array would be an array of pointers and glVertexPointer doesn't take an array of pointers, so no, it would not work. [/quote] What about if i do it this way ? [code] vector<SomeClassName> nodes; [/code]
  6. Hi everyone, I was wondering if there is a good way to use [code] void glVertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ); [/code] with [code]vector<SomeClassName *> Nodes; [/code] since its more convenient, and easy to store information in the vector. Any help would be appreciated.
  7. [color="#1C2837"][size="2"] [color="#1C2837"][size="2"]Hi all [/size][/color] I am developing Pre/Post processor for the Finite Element Method code, using C++ Builder 2007 and OpenGL on Windows OS.[/size][/color] [color="#1C2837"][size="2"]I would like to ask if there is anyway to call FEM code which is located on the remote server/pc. Server is accessible trough web protocols. [/size][/color] [color="#1C2837"][size="2"]So what I would like to accomplish, is to provide shell software to the users that they can run on they computer for Pre/Post processing if they want to run the analysis they had to submit it to the server. Ideally trough the same shell software, which will handle that. [/size][/color] [color="#1C2837"][size="2"]Right now I am calling FEM code which is on the same machine using [url=""]CreateProcess(..)[/url] it generates output files which I load into the shell program to show results. [/size][/color] [color="#1C2837"][size="2"]If anyone can point me to the right direction i would be highly grateful. If you need any additional information please feel free to ask. [/size][/color]
  8. Eliminating the need to install application

    Thanks for all your responses.
  9. Eliminating the need to install application

    Dear [b]ncite[/b] [b] [/b] Actually thats what I do right now but this requires Administrative access to the machine and not all the users have that. Which at the same time refutes the title of this topic "Eliminating the need to install the application". In some places it's even required that software would execute without installing and accessing registry.
  10. Eliminating the need to install application

    [size="2"][color="#1C2837"]Dear [b]kdmiller3[/b][/color][/size] [size="2"][color="#1C2837"][b] [/b][/color][/size] [size="2"][color="#1C2837"]Thanks for your fast reply. [/color][/size] [size="2"][color="#1C2837"] [/color][/size] [size="2"][color="#1C2837"]My [/color][/size][color=#1C2837][size=2]Project -> Options... -> Linker: Linking: [b]is [/b]unchecked "Use Dynamic RTL" but I still have the same problem, [/size][/color] [color=#1C2837][size=2] [/size][/color] [size="2"][color="#1C2837"]and no my program doesn't run with those packages in the same folder. As it states [url=""]here[/url] [b] "[/b][/color][/size][b]Runtime packages called by design packages must be located somewhere on your system's path.[color=#1C2837][size=2]"[/size][/color][/b] [b][color=#1C2837][size=2] [/size][/color][/b] [color="#1C2837"][size="2"]I don't mind if my executable will be large as long as it could execute without need of additional packages. [/size][/color] [color="#1C2837"][size="2"] [/size][/color] [color="#1C2837"][size="2"]I am getting very frustrated with C++ Builder I thought that deployment of your project would be somehow more documented. [/size][/color] [color="#1C2837"][size="2"] [/size][/color] [size="2"][color="#1C2837"] [/color][/size]
  11. Eliminating the need to install application

    Dear [b]kdmiller3[/b] [b] [/b] Thanks for your reply but my software requires some packages to be installed in "C:\Windows\System32\" folder such as [code] "rtl100.bpl" "tee7100.bpl" "vcl100.bpl" "vclx100.bpl" "vcldb100.bpl" "dbrtl100.bpl"[/code] Since I am using C++ Builders VCL components. I tried to compile release version of my project by going to Project -> Options -> Packages, and un-checking "Build with runtime packages" but I get exception Access Violation message when I compile. My project runs completely fine in Debug Configuration, and I am 100% sure that I am not accessing anything which could through Access Violation during initial start of my program. Also I will need to read and write some files while my program is running. I guess my question is turning more C++ Builder specific but any help would be appreciated. Thanks in advance.
  12. Hi all, I am relatively new in this forum, so accept my apology if I posted this question in the wrong thread. I am Graduate student and I am developing Pre/Post processor for the Finite Element Method code, using C++ Builder 2007 and OpenGL. I wanted to ask if anyone knows or can redirect me to the open source or free software which will hep to [color="#333333"][font="Arial, Helvetica, sans-serif"]eliminate the need to install my software applications before running them. I already spend two days searching the web without any luck. [/font][/color] [color="#333333"][font="Arial, Helvetica, sans-serif"] [/font][/color] [font="Arial, Helvetica, sans-serif"][color="#333333"]Something like [url=""]this[/url] but without huge price tag. [/color][/font] [font="Arial, Helvetica, sans-serif"] [/font] [font="Arial, Helvetica, sans-serif"][color="#333333"]Any advice would be appreciated.[/color][/font] [font="Arial, Helvetica, sans-serif"] [/font] [font="Arial, Helvetica, sans-serif"][color="#333333"]Thanks in advance. [/color][/font]
  13. Screenshot or snapshot from OpenGL .....

    TO Orrill Example which you give me a link don’t work even it’s create a file which tga format and can't be viewed I need simple bmp file.
  14. Screenshot or snapshot from OpenGL .....

    can anyone help me ? [Edited by - sobaka on May 3, 2007 10:29:12 PM]
  15. Screenshot or snapshot from OpenGL .....

    Thanks for answers, is they are any tutorials for this? Or everybody doing by they own style or whatever.