Let $X \subset \mathbb{P}^n $ be a complex hypersurface of degree $d$. I'm trying to calculate the global sections of $\mathcal{O}(r)_{|X}$ for $r \in \mathbb{Z}$. This is what (I think) I have so far:
By the long exact sequence in cohomology and Kodaira Vanishing theorem we have a short exact sequence: $$ 0 \to H^0(\mathbb{P}^n,\mathcal{O}(r-d)) \to H^0(\mathbb{P}^n,\mathcal{O}(r)) \to H^0(X,\mathcal{O}(r)_{|X}) \to 0$$
I can identify $H^0(\mathbb{P}^n,\mathcal{O}(r)) $ with homogeneous polynomials of degree $r$.
As I understand it, the second map in the above sequence is induced by tensoring the map $ j^\sharp: \mathcal{O}_{\mathbb{P}^n} \to j_* \mathcal{O}_X $, where $j:X \subset \mathbb{P}^n$, with $\mathcal{O}(r)$, and then applying the projection formula.
1) does what I've written make sense?
2) If so, how does $H^0(\mathbb{P}^n, \mathcal{O}(r-d))$ get identified with the kernel here? Do I need to look at the first map given by the inclusion of the ideal sheaf $\mathcal{I}_X \cong \mathcal{O}(-d)$?
Apologies if I'm being real stupid here.