Giter Site home page Giter Site logo

Comments (17)

RobertAron avatar RobertAron commented on August 21, 2024 7

Hey, I had the same issue and just got it working for me. I think the main issue was fighting with visual studio more than the actual code. I was attempting to follow along with the other code inside the 'playground' and got stuck here for quite a while.

The problem I ran into was that visual studio doesn't copy files that you make inside of it into the working directory. If you make a 'shaders' filter and then add two files inside of it these files won't be exported into the working directory so when you try to open them using your program they don't exsist.

I did the following to keep up with the tutorials. I'm not sure if this is really a best practice or anything, but it worked for me.

  1. Copy the two shaders from the file '.../ogl-master/tutorial02_red_triangle'
  2. Paste them into '.../ogl-master/playground'
  3. In Visual Studio Make a 'shaders' filter inside the 'playground' project
  4. Drag the two filters from the 'playground' folder into the 'shaders' filter.

from ogl.

 avatar commented on August 21, 2024 2

You should copy the shader to the playground folder as well, that means both SimpleVertexShader.vertexshader and SimpleFragmentShader.fragmentshader.

from ogl.

cuberinooo avatar cuberinooo commented on August 21, 2024 2

I just moved the SimpleFragmentShader.fragmentshader and the SimpleVertexSahder.vertexShader to the cmake-build-debug dir.
(Btw. im using Clion + Windows 10)

from ogl.

bar4488 avatar bar4488 commented on August 21, 2024 1

when using xcode it doesnt create the shader file inside the playground directory by default, you need to specify when you create the shader file that it will be inside the playground directory.

from ogl.

Alphamplyer avatar Alphamplyer commented on August 21, 2024 1

In CLion, change the run/debug configuration : Set at working directory the playground directory path.
image

from ogl.

boki565 avatar boki565 commented on August 21, 2024 1

In CLion, change the run/debug configuration : Set at working directory the playground directory path.

thank you!

from ogl.

IJEMIN avatar IJEMIN commented on August 21, 2024

got it! I will fix that and update with new translation!

from ogl.

xarthurx avatar xarthurx commented on August 21, 2024

Still have this issue.
I'm using windows 10 and VS2017.

Seems no one has run into this issue...
I've been searching the Internet for a while and cannot find a solution.

from ogl.

opengl-tutorial avatar opengl-tutorial commented on August 21, 2024

from ogl.

Calvin1602 avatar Calvin1602 commented on August 21, 2024

For people stumbing on this later :
The .exe must be started from the SOURCE folder, so that it can find the required files ! (shaders, textures, models)
This is thorougly explained in the FAQ.
Either :

  • Copy-paste the .exe from the build dir to the source dir, and start it (the CMakeList already does this)
  • Copy-paste the resources in the build dir
  • cd in the source dir, but start ../../your_build_dir/tutorialXX.exe
  • Or just start it from the IDE, it's been configured to Just Work !

from ogl.

loongenix avatar loongenix commented on August 21, 2024

I have this issue too. I'm using clion.

from ogl.

gracemarod avatar gracemarod commented on August 21, 2024

Hello, I keep running into the same issue even though I copy paste the Tutorial_02 code, the SimpleVertexShader.vertexshader and SimpleFragmentShader.fragmentshader into the Playground folder. Even with the code that's on the Tutorial_02 unedited folder, it keeps saying "Impossible to open SimpleVertexShader.vertexshader. Are you in the right directory?"
I'm using Xcode on a 2011 Mac.

from ogl.

RoyZhang7 avatar RoyZhang7 commented on August 21, 2024

Hey, I had the same issue and just got it working for me. I think the main issue was fighting with visual studio more than the actual code. I was attempting to follow along with the other code inside the 'playground' and got stuck here for quite a while.

The problem I ran into was that visual studio doesn't copy files that you make inside of it into the working directory. If you make a 'shaders' filter and then add two files inside of it these files won't be exported into the working directory so when you try to open them using your program they don't exsist.

I did the following to keep up with the tutorials. I'm not sure if this is really a best practice or anything, but it worked for me.

  1. Copy the two shaders from the file '.../ogl-master/tutorial02_red_triangle'
  2. Paste them into '.../ogl-master/playground'
  3. In Visual Studio Make a 'shaders' filter inside the 'playground' project
  4. Drag the two filters from the 'playground' folder into the 'shaders' filter.

Only your answer works for me. Thanks. Hope others get here via google see this.

from ogl.

lukvmil avatar lukvmil commented on August 21, 2024

Hey, I had the same issue and just got it working for me. I think the main issue was fighting with visual studio more than the actual code. I was attempting to follow along with the other code inside the 'playground' and got stuck here for quite a while.

The problem I ran into was that visual studio doesn't copy files that you make inside of it into the working directory. If you make a 'shaders' filter and then add two files inside of it these files won't be exported into the working directory so when you try to open them using your program they don't exsist.

I did the following to keep up with the tutorials. I'm not sure if this is really a best practice or anything, but it worked for me.

1. Copy the two shaders from the file '.../ogl-master/tutorial02_red_triangle'

2. Paste them into '.../ogl-master/playground'

3. In Visual Studio Make a 'shaders' filter inside the 'playground' project

4. Drag the two filters from the 'playground' folder into the 'shaders' filter.

This worked for me thanks! For people in the future, on line 4, "filters" should be "files". Drag the two shader files you copied into the playground folder into the shaders filter in Visual Studio.

from ogl.

papago2355 avatar papago2355 commented on August 21, 2024

Hey, I had the same issue and just got it working for me. I think the main issue was fighting with visual studio more than the actual code. I was attempting to follow along with the other code inside the 'playground' and got stuck here for quite a while.

The problem I ran into was that visual studio doesn't copy files that you make inside of it into the working directory. If you make a 'shaders' filter and then add two files inside of it these files won't be exported into the working directory so when you try to open them using your program they don't exsist.

I did the following to keep up with the tutorials. I'm not sure if this is really a best practice or anything, but it worked for me.

  1. Copy the two shaders from the file '.../ogl-master/tutorial02_red_triangle'
  2. Paste them into '.../ogl-master/playground'
  3. In Visual Studio Make a 'shaders' filter inside the 'playground' project
  4. Drag the two filters from the 'playground' folder into the 'shaders' filter.

Yep, this is totally working fine with me! I keep feeling stupid when I thought filters as folders..

from ogl.

boki565 avatar boki565 commented on August 21, 2024

Hey! have windows 10 and visual studio 19. I did everithing as @RobertAron said and itdi change a bit but its still not working. I got this in comand window

slika

slika

from ogl.

chrisdel101 avatar chrisdel101 commented on August 21, 2024

Using absolute paths worked for me: Right click 'File Inspector' -> 'Relative to Project' -> Location 'Absolute Path'

But this not a good solution. Why will relative path not work? All flies are inside the project I am running i.e. playground/shaders/SimpleVertexShader.vertexshader.

from ogl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.