Sign in to follow this  
Bru

OpenGL DirectX... costs money?

Recommended Posts

Bru    100
i recently read somewhere that if i try selling my game(that uses directX),i'll need to pay for a license. is it true? if it is,that's problematic for me. i am a sole person and i probably cant pay for a license. i am also using directX in order to be more impressive when i present my game when i try to get into a gaming company. i dont want to use openGL because then i'll go into a lower level and need to build myself more functions and classes(and i try not to use external libarys too much). a real engine? well i heared unity is nice,but now everybody seems to be using it and considering the fact i wont have a degree soon i need to be extrodinary if i want to get a job as a game programmer... not mention i dont want a unity watermark appearing on my game for using the free version. so... does directX realy cost money when i try selling my game?

Share this post


Link to post
Share on other sites
Dbproguy    108
I have yet to find something that says you have to purchase a license to use it. You already have to use Microsoft Windows and Visual Studio before you can use DirectX anyways, and if you only use Visual Studio Express, I believe I've heard there are limitations on commercial distribution of applications coded in Visual Studio Express.

I'm assuming since they include the redist for free: http://www.microsoft.com/downloads/details.aspx?familyid=0cf368e5-5ce1-4032-a207-c693d210f616&displaylang=en then there is no license required.

Share this post


Link to post
Share on other sites
Codeka    1239
Quote:
Original post by Dbproguy
if you only use Visual Studio Express, I believe I've heard there are limitations on commercial distribution of applications coded in Visual Studio Express.
That is not true, there is no limit to commercial distribution even if you use the Express versions.

I don't know where you heard that you need pay to any license fees, but it's not true.

Share this post


Link to post
Share on other sites
Quote:
Original post by Codeka
Quote:
Original post by Dbproguy
if you only use Visual Studio Express, I believe I've heard there are limitations on commercial distribution of applications coded in Visual Studio Express.
That is not true, there is no limit to commercial distribution even if you use the Express versions.

I don't know where you heard that you need pay to any license fees, but it's not true.

True there is no fee, but there are some limits DirectX's use, regardless of which VStudio edition you're using. Not in quantity of sales or anything, just on how you're allowed to ship/install the needed files. You are not allowed to just pack a few DLLs in the same directory as your app. You can only distribute the redistributable installer packages that Microsoft allows. All the details on which files must be present, what's optional, etc, are contained in the REDIST folder of your SDK. If you don't want to ship with the redist packages, then you should point your users to the DirectX Web Installer.

Share this post


Link to post
Share on other sites
NightCabbage    100
Hmmm, on this note... I'm using Visual Studio C++ 2008, but just for the compiler (not .NET or anything).

When I distribute a game, will the game just run on anyone's system?

Or will they need to install something? If so, is there some other compiler I should be using instead of VS? Also, if this is the case, why is it that I would need some extra package just to run a standard C++ program?

Share this post


Link to post
Share on other sites
Hodgman    51231
Quote:
Original post by NightCabbage
Hmmm, on this note... I'm using Visual Studio C++ 2008, but just for the compiler (not .NET or anything). When I distribute a game, will the game just run on anyone's system? Or will they need to install something?
Yes you'll need them to install the visual C++ runtime. You can integrate this installer with your own game's installer though, so both packages are installed at once.

You can find the installer by doing a search for "Microsoft Visual C++ 2008 Redistributable Package".
Quote:
why is it that I would need some extra package just to run a standard C++ program?
Your game is compiled down to native code, BUT it will likely be linked to Microsoft DLLs, for functions such as printf, timeGetTime, fopen, etc... These DLLs are installed by the redist package.

Share this post


Link to post
Share on other sites
jpetrie    13104
Quote:

Or will they need to install something? If so, is there some other compiler I should be using instead of VS? Also, if this is the case, why is it that I would need some extra package just to run a standard C++ program?

Because C++ isn't "standard" in that sense. All C and C++ programs need a runtime to execute -- that's where your "standard" functions come from, implemented in terms of the OS functions for the same. The difference with C++ is that those runtimes can be linked in to your program as static libraries, although that is discouraged these days in favor of linking dynamically (which means you need to package the redistributable for your runtime version with your installer).

Share this post


Link to post
Share on other sites
Codeka    1239
Note also that all C++ compilers have a runtime library component, it's just that some compilers choose to link to their statically, rather than dynamically.

Microsoft chose to link to the C++ runtime dynamically (by default) because it allows them to patch security vulnerabilities that may be found without requiring you to recompile and have all your clients re-download your application. Not that there's ever been a security vulnerability in the VC++ runtime (that I'm aware of), but it's theoretically possible - they learnt this lession with the JPEG vulnerability that was found in GDI+ a few years back: all applications that had distributed private copies of GDI+ had to be updated separately, and it was a nightmare for sysadmins!

In any case, the redist for the runtime is quite small. But if you're really against the idea of including it with your installer, you can link to the VC++ runtime statically instead. There are issues when linking with the C++ runtime statically (particularly if your application uses DLLs) but as long as you understand those and are willing to take on the responsibilty of monitoring for security issues in the runtime (you should always be monitoring for security [and other] issues in all your dependencies, of course) then it's an option.

Share this post


Link to post
Share on other sites
NightCabbage    100
(Thanks to the above 3 posters!)

Ah, that's interesting... so it's about the libraries that it's linking to, not the actual compiled code itself. That makes sense.

So how do people get normal programs that are made in C++ to run on Windows without needing to install anything?

I don't think I've seen many "professional" games that require the redistributable package to run... why is this?

Should I be doing that? Or is it a good idea to just package the redistributable and be done with it?

Share this post


Link to post
Share on other sites
jpetrie    13104
Those programs either link statically with their dependencies (but this is not always possible or advisable, for example, you cannot statically link to the DirectX libraries), or they bundle the redistributable installer with their own installer and quietly install it during the installation phase of the program.

Share this post


Link to post
Share on other sites
Codeka    1239
Quote:
Original post by NightCabbage
I don't think I've seen many "professional" games that require the redistributable package to run... why is this?
I think we posted at the same time, so I won't go over static linking again, but most games will include the VC++ runtime as part of their installation. It's a "silent" install, so you don't actually see it installing, but if you go to your Control Panel, Programs listing, you'll probably see a bunch of "Microsoft Visual C++ 20xx Redistributable" entries - these are the runtime components that other applications have installed for you.

Because they're separate entries like that, it means Microsoft can update them as part of your regular Windows Update cycle. That's how the security fixes come in.

The redist package is about 1-2MB, so it's not very big when compared to the game itself (usually).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By Zaphyk
      I am developing my engine using the OpenGL 3.3 compatibility profile. It runs as expected on my NVIDIA card and on my Intel Card however when I tried it on an AMD setup it ran 3 times worse than on the other setups. Could this be a AMD driver thing or is this probably a problem with my OGL code? Could a different code standard create such bad performance?
    • By Kjell Andersson
      I'm trying to get some legacy OpenGL code to run with a shader pipeline,
      The legacy code uses glVertexPointer(), glColorPointer(), glNormalPointer() and glTexCoordPointer() to supply the vertex information.
      I know that it should be using setVertexAttribPointer() etc to clearly define the layout but that is not an option right now since the legacy code can't be modified to that extent.
      I've got a version 330 vertex shader to somewhat work:
      #version 330 uniform mat4 osg_ModelViewProjectionMatrix; uniform mat4 osg_ModelViewMatrix; layout(location = 0) in vec4 Vertex; layout(location = 2) in vec4 Normal; // Velocity layout(location = 3) in vec3 TexCoord; // TODO: is this the right layout location? out VertexData { vec4 color; vec3 velocity; float size; } VertexOut; void main(void) { vec4 p0 = Vertex; vec4 p1 = Vertex + vec4(Normal.x, Normal.y, Normal.z, 0.0f); vec3 velocity = (osg_ModelViewProjectionMatrix * p1 - osg_ModelViewProjectionMatrix * p0).xyz; VertexOut.velocity = velocity; VertexOut.size = TexCoord.y; gl_Position = osg_ModelViewMatrix * Vertex; } What works is the Vertex and Normal information that the legacy C++ OpenGL code seem to provide in layout location 0 and 2. This is fine.
      What I'm not getting to work is the TexCoord information that is supplied by a glTexCoordPointer() call in C++.
      Question:
      What layout location is the old standard pipeline using for glTexCoordPointer()? Or is this undefined?
       
      Side note: I'm trying to get an OpenSceneGraph 3.4.0 particle system to use custom vertex, geometry and fragment shaders for rendering the particles.
    • By markshaw001
      Hi i am new to this forum  i wanted to ask for help from all of you i want to generate real time terrain using a 32 bit heightmap i am good at c++ and have started learning Opengl as i am very interested in making landscapes in opengl i have looked around the internet for help about this topic but i am not getting the hang of the concepts and what they are doing can some here suggests me some good resources for making terrain engine please for example like tutorials,books etc so that i can understand the whole concept of terrain generation.
       
    • By KarimIO
      Hey guys. I'm trying to get my application to work on my Nvidia GTX 970 desktop. It currently works on my Intel HD 3000 laptop, but on the desktop, every bind textures specifically from framebuffers, I get half a second of lag. This is done 4 times as I have three RGBA textures and one depth 32F buffer. I tried to use debugging software for the first time - RenderDoc only shows SwapBuffers() and no OGL calls, while Nvidia Nsight crashes upon execution, so neither are helpful. Without binding it runs regularly. This does not happen with non-framebuffer binds.
      GLFramebuffer::GLFramebuffer(FramebufferCreateInfo createInfo) { glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); textures = new GLuint[createInfo.numColorTargets]; glGenTextures(createInfo.numColorTargets, textures); GLenum *DrawBuffers = new GLenum[createInfo.numColorTargets]; for (uint32_t i = 0; i < createInfo.numColorTargets; i++) { glBindTexture(GL_TEXTURE_2D, textures[i]); GLint internalFormat; GLenum format; TranslateFormats(createInfo.colorFormats[i], format, internalFormat); // returns GL_RGBA and GL_RGBA glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, createInfo.width, createInfo.height, 0, format, GL_FLOAT, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); DrawBuffers[i] = GL_COLOR_ATTACHMENT0 + i; glBindTexture(GL_TEXTURE_2D, 0); glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, textures[i], 0); } if (createInfo.depthFormat != FORMAT_DEPTH_NONE) { GLenum depthFormat; switch (createInfo.depthFormat) { case FORMAT_DEPTH_16: depthFormat = GL_DEPTH_COMPONENT16; break; case FORMAT_DEPTH_24: depthFormat = GL_DEPTH_COMPONENT24; break; case FORMAT_DEPTH_32: depthFormat = GL_DEPTH_COMPONENT32; break; case FORMAT_DEPTH_24_STENCIL_8: depthFormat = GL_DEPTH24_STENCIL8; break; case FORMAT_DEPTH_32_STENCIL_8: depthFormat = GL_DEPTH32F_STENCIL8; break; } glGenTextures(1, &depthrenderbuffer); glBindTexture(GL_TEXTURE_2D, depthrenderbuffer); glTexImage2D(GL_TEXTURE_2D, 0, depthFormat, createInfo.width, createInfo.height, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glBindTexture(GL_TEXTURE_2D, 0); glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, depthrenderbuffer, 0); } if (createInfo.numColorTargets > 0) glDrawBuffers(createInfo.numColorTargets, DrawBuffers); else glDrawBuffer(GL_NONE); if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) std::cout << "Framebuffer Incomplete\n"; glBindFramebuffer(GL_FRAMEBUFFER, 0); width = createInfo.width; height = createInfo.height; } // ... // FBO Creation FramebufferCreateInfo gbufferCI; gbufferCI.colorFormats = gbufferCFs.data(); gbufferCI.depthFormat = FORMAT_DEPTH_32; gbufferCI.numColorTargets = gbufferCFs.size(); gbufferCI.width = engine.settings.resolutionX; gbufferCI.height = engine.settings.resolutionY; gbufferCI.renderPass = nullptr; gbuffer = graphicsWrapper->CreateFramebuffer(gbufferCI); // Bind glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); // Draw here... // Bind to textures glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, textures[0]); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, textures[1]); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, textures[2]); glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, depthrenderbuffer); Here is an extract of my code. I can't think of anything else to include. I've really been butting my head into a wall trying to think of a reason but I can think of none and all my research yields nothing. Thanks in advance!
    • By Adrianensis
      Hi everyone, I've shared my 2D Game Engine source code. It's the result of 4 years working on it (and I still continue improving features ) and I want to share with the community. You can see some videos on youtube and some demo gifs on my twitter account.
      This Engine has been developed as End-of-Degree Project and it is coded in Javascript, WebGL and GLSL. The engine is written from scratch.
      This is not a professional engine but it's for learning purposes, so anyone can review the code an learn basis about graphics, physics or game engine architecture. Source code on this GitHub repository.
      I'm available for a good conversation about Game Engine / Graphics Programming
  • Popular Now