Jump to content
  • Advertisement

Esentiel

Member
  • Content count

    11
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Esentiel

  • Rank
    Member

Personal Information

  • Interests
    Programming
  1. Hello, What I'm trying to do: Create solution with 2 projects: 1. DLL which uses OpenGL and provide me with higher level of abstraction to draw entities. 2. Application which uses DLL from p1. So I created both projects, set up __declspec(dllimport) for every class method in the DLL project. now this very project can be compiled w\o any errors. In the Application project I added path to headers from the DLL project. Added .lib file generated in the DLL project and it's location into linker properties of the Application project. For me it seems to be ok. Nevertheless, I used Glew, glm headers in my headers within the DLL project. And now when I'm trying to compile the Application project I got an error indicating glew.h and/or glm.hpp couldn't be found. Basically, afaik the reason is I got path for those headers into my DLL project config, but not into Application project config. How can I avoid adding paths to glew.h and glm.hpp into the Application project's config? I tried to use forward declaration in my headers and include those headers into cpp files. And it worked for most cases, except probably only one (I need Vertex2 and Vertex3 to be visible when this file was included): #pragma once #include <glm/glm.hpp> template <class T> class Vertex; typedef Vertex<glm::vec3> Vertex3; typedef Vertex<glm::vec2> Vertex2; template <class T> class Vertex { public: Vertex() : pos(T(0, 0, 0)) {} Vertex(const T& pos) : pos(pos) {} Vertex(float x, float y, float z ) : pos(T(x, y, z)) {} Vertex(float x, float y) : pos(T(x, y)) {} T& GetGLM() { return pos; } const T& GetGLM() const { return pos; } private: T pos; }; Thank you in advance, Esentiel
  2. Esentiel

    Loading texture from dds file

    The problem was I created in a separate file another buffer and vertex array object. Here in texture I haven't created such object. So I need to move this code to the place where vertex array object is bound.
  3. Esentiel

    Loading texture from dds file

    Ok, I got an idea. It seems something wrong with uv coordinates. Because, when I changed one row in vertex shader to UV = vertexPosition_modelspace.xy; I got ugly stretched texture on my triangle. Maybe I filled buffer in a wrong way.
  4. Hello everyone! I'm trying to complete OpenGL tutorial http://www.opengl-tutorial.org/beginners-tutorials/tutorial-5-a-textured-cube/ And I faced a problem when loading texture from dds file to my triangle. Here is my code (basically from the tutorial): Load DDS from file(Texture.cpp): https://pastebin.com/Y5TKPvue Vertex shader: https://pastebin.com/2pPXQkS9 Fragment shader: https://pastebin.com/4nF2jVMy dds file: https://drive.google.com/open?id=1yYF2oyLbqn-OMB_QxZKyzKwBwxl_9sCb rendered window: https://imgur.com/a/1pP92 In main file I call drawing triangle, I call texture.Bind(); Also I tried to manually set uv points in fragment shader, and it seems working(color might be changed based on coordinates). If you have any idea, will be really appreciated. Regards, Esentiel
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!